diff --git a/.librarian/state.yaml b/.librarian/state.yaml index b2a02a6b3a8a..b42fd4b6c6c1 100644 --- a/.librarian/state.yaml +++ b/.librarian/state.yaml @@ -2,7 +2,7 @@ image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-li libraries: - id: google-ads-admanager version: 0.5.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/ads/admanager/v1 service_config: admanager_v1.yaml @@ -21,7 +21,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-ads-marketingplatform-admin version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/marketingplatform/admin/v1alpha service_config: marketingplatformadmin_v1alpha.yaml @@ -40,7 +40,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-ai-generativelanguage version: 0.8.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/ai/generativelanguage/v1 service_config: generativelanguage_v1.yaml @@ -67,7 +67,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-analytics-admin version: 0.26.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/analytics/admin/v1beta service_config: analyticsadmin_v1beta.yaml @@ -88,7 +88,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-analytics-data version: 0.19.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/analytics/data/v1alpha service_config: analyticsdata_v1alpha.yaml @@ -109,7 +109,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-apps-card version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/apps/card/v1 service_config: "" @@ -148,7 +148,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-apps-events-subscriptions version: 0.3.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/apps/events/subscriptions/v1 service_config: workspaceevents_v1.yaml @@ -169,7 +169,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-apps-meet version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/apps/meet/v2beta service_config: meet_v2beta.yaml @@ -190,7 +190,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-apps-script-type version: 0.4.0 - last_generated_commit: 329ace5e3712a2e37d6159d4dcd998d8c73f261e + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/apps/script/type service_config: "" @@ -228,7 +228,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-area120-tables version: 0.12.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/area120/tables/v1alpha1 service_config: area120tables_v1alpha1.yaml @@ -247,7 +247,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-access-approval version: 1.17.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/accessapproval/v1 service_config: accessapproval_v1.yaml @@ -266,7 +266,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-access-context-manager version: 0.3.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/identity/accesscontextmanager/v1 service_config: accesscontextmanager_v1.yaml @@ -280,7 +280,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-advisorynotifications version: 0.4.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/advisorynotifications/v1 service_config: advisorynotifications_v1.yaml @@ -299,7 +299,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-alloydb version: 0.6.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/alloydb/v1beta service_config: alloydb_v1beta.yaml @@ -322,7 +322,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-alloydb-connectors version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/alloydb/connectors/v1 service_config: connectors_v1.yaml @@ -346,7 +346,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-api-gateway version: 1.13.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/apigateway/v1 service_config: apigateway_v1.yaml @@ -365,7 +365,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-api-keys version: 0.6.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/api/apikeys/v2 service_config: apikeys_v2.yaml @@ -384,7 +384,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-apigee-connect version: 1.13.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/apigeeconnect/v1 service_config: apigeeconnect_v1.yaml @@ -403,7 +403,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-apigee-registry version: 0.7.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/apigeeregistry/v1 service_config: apigeeregistry_v1.yaml @@ -422,7 +422,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-apihub version: 0.4.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/apihub/v1 service_config: apihub_v1.yaml @@ -441,7 +441,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-appengine-admin version: 1.15.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/appengine/v1 service_config: appengine_v1.yaml @@ -460,7 +460,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-appengine-logging version: 1.7.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/appengine/logging/v1 service_config: "" @@ -480,7 +480,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-apphub version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/apphub/v1 service_config: apphub_v1.yaml @@ -499,7 +499,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-artifact-registry version: 1.17.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/devtools/artifactregistry/v1 service_config: artifactregistry_v1.yaml @@ -520,7 +520,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-asset version: 4.1.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/asset/v1p5beta1 service_config: cloudasset_v1p5beta1.yaml @@ -545,7 +545,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-assured-workloads version: 2.1.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/assuredworkloads/v1 service_config: assuredworkloads_v1.yaml @@ -566,7 +566,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-audit-log version: 0.4.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/audit service_config: cloudaudit.yaml @@ -578,7 +578,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-automl version: 2.17.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/automl/v1beta1 service_config: automl_v1beta1.yaml @@ -604,7 +604,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-backupdr version: 0.3.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/backupdr/v1 service_config: backupdr_v1.yaml @@ -623,7 +623,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bare-metal-solution version: 1.11.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/baremetalsolution/v2 service_config: baremetalsolution_v2.yaml @@ -642,7 +642,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-batch version: 0.18.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/batch/v1alpha service_config: batch_v1alpha.yaml @@ -663,7 +663,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-beyondcorp-appconnections version: 0.5.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/beyondcorp/appconnections/v1 service_config: beyondcorp_v1.yaml @@ -682,7 +682,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-beyondcorp-appconnectors version: 0.5.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/beyondcorp/appconnectors/v1 service_config: beyondcorp_v1.yaml @@ -701,7 +701,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-beyondcorp-appgateways version: 0.5.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/beyondcorp/appgateways/v1 service_config: beyondcorp_v1.yaml @@ -720,7 +720,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-beyondcorp-clientconnectorservices version: 0.5.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/beyondcorp/clientconnectorservices/v1 service_config: beyondcorp_v1.yaml @@ -739,7 +739,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-beyondcorp-clientgateways version: 0.5.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/beyondcorp/clientgateways/v1 service_config: beyondcorp_v1.yaml @@ -758,10 +758,10 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-biglake version: 0.1.1 - last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/biglake/v1 - service_config: "" + service_config: biglake_v1.yaml source_roots: - packages/google-cloud-biglake preserve_regex: @@ -777,7 +777,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bigquery-analyticshub version: 0.5.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/bigquery/analyticshub/v1 service_config: analyticshub_v1.yaml @@ -796,7 +796,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bigquery-biglake version: 0.5.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/bigquery/biglake/v1alpha1 service_config: biglake_v1alpha1.yaml @@ -817,7 +817,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bigquery-connection version: 1.19.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/bigquery/connection/v1 service_config: bigqueryconnection_v1.yaml @@ -836,7 +836,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bigquery-data-exchange version: 0.6.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/bigquery/dataexchange/v1beta1 service_config: analyticshub_v1beta1.yaml @@ -855,7 +855,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bigquery-datapolicies version: 0.7.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/bigquery/datapolicies/v2beta1 service_config: bigquerydatapolicy_v2beta1.yaml @@ -880,7 +880,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bigquery-datatransfer version: 3.20.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/bigquery/datatransfer/v1 service_config: bigquerydatatransfer_v1.yaml @@ -899,7 +899,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bigquery-logging version: 1.7.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/bigquery/logging/v1 service_config: "" @@ -919,7 +919,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bigquery-migration version: 0.12.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/bigquery/migration/v2alpha service_config: bigquerymigration_v2alpha.yaml @@ -940,7 +940,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-bigquery-reservation version: 1.21.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/bigquery/reservation/v1 service_config: bigqueryreservation_v1.yaml @@ -959,7 +959,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-billing version: 1.17.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/billing/v1 service_config: cloudbilling_v1.yaml @@ -978,7 +978,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-billing-budgets version: 1.18.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/billing/budgets/v1 service_config: billingbudgets.yaml @@ -999,7 +999,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-binary-authorization version: 1.14.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/binaryauthorization/v1 service_config: binaryauthorization_v1.yaml @@ -1020,7 +1020,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-build version: 3.33.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/devtools/cloudbuild/v1 service_config: cloudbuild_v1.yaml @@ -1041,7 +1041,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-capacityplanner version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/capacityplanner/v1beta service_config: capacityplanner_v1beta.yaml @@ -1060,7 +1060,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-certificate-manager version: 1.11.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/certificatemanager/v1 service_config: certificatemanager_v1.yaml @@ -1079,7 +1079,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-channel version: 1.24.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/channel/v1 service_config: cloudchannel_v1.yaml @@ -1098,7 +1098,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-chronicle version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/chronicle/v1 service_config: chronicle_v1.yaml @@ -1117,7 +1117,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-cloudcontrolspartner version: 0.3.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/cloudcontrolspartner/v1beta service_config: cloudcontrolspartner_v1beta.yaml @@ -1138,7 +1138,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-cloudsecuritycompliance version: 0.3.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/cloudsecuritycompliance/v1 service_config: cloudsecuritycompliance_v1.yaml @@ -1157,7 +1157,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-commerce-consumer-procurement version: 0.3.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/commerce/consumer/procurement/v1 service_config: cloudcommerceconsumerprocurement_v1.yaml @@ -1178,7 +1178,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-common version: 1.6.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/common service_config: common.yaml @@ -1198,7 +1198,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-compute version: 1.40.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/compute/v1 service_config: compute_v1.yaml @@ -1217,7 +1217,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-compute-v1beta version: 0.3.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/compute/v1beta service_config: compute_v1beta.yaml @@ -1236,7 +1236,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-confidentialcomputing version: 0.6.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/confidentialcomputing/v1 service_config: confidentialcomputing_v1.yaml @@ -1255,7 +1255,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-config version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/config/v1 service_config: config_v1.yaml @@ -1274,7 +1274,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-configdelivery version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/configdelivery/v1beta service_config: configdelivery_v1beta.yaml @@ -1297,7 +1297,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-contact-center-insights version: 1.24.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/contactcenterinsights/v1 service_config: contactcenterinsights_v1.yaml @@ -1316,7 +1316,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-container version: 2.60.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/container/v1 service_config: container_v1.yaml @@ -1337,7 +1337,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-containeranalysis version: 2.19.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/devtools/containeranalysis/v1 service_config: containeranalysis_v1.yaml @@ -1357,7 +1357,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-contentwarehouse version: 0.8.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/contentwarehouse/v1 service_config: contentwarehouse_v1.yaml @@ -1376,7 +1376,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-data-fusion version: 1.14.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/datafusion/v1 service_config: datafusion_v1.yaml @@ -1395,7 +1395,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-data-qna version: 0.11.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/dataqna/v1alpha service_config: dataqna_v1alpha.yaml @@ -1414,7 +1414,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-datacatalog version: 3.28.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/datacatalog/v1 service_config: datacatalog_v1.yaml @@ -1435,7 +1435,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-datacatalog-lineage version: 0.4.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/datacatalog/lineage/v1 service_config: datalineage_v1.yaml @@ -1454,7 +1454,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-dataflow-client version: 0.10.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/dataflow/v1beta3 service_config: dataflow_v1beta3.yaml @@ -1473,7 +1473,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-dataform version: 0.7.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/dataform/v1beta1 service_config: dataform_v1beta1.yaml @@ -1494,7 +1494,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-datalabeling version: 1.14.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/datalabeling/v1beta1 service_config: datalabeling_v1beta1.yaml @@ -1513,7 +1513,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-dataplex version: 2.13.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/dataplex/v1 service_config: dataplex_v1.yaml @@ -1532,7 +1532,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-dataproc version: 5.23.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/dataproc/v1 service_config: dataproc_v1.yaml @@ -1551,7 +1551,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-dataproc-metastore version: 1.20.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/metastore/v1alpha service_config: metastore_v1alpha.yaml @@ -1574,7 +1574,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-datastream version: 1.16.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/datastream/v1 service_config: datastream_v1.yaml @@ -1595,7 +1595,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-deploy version: 2.8.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/deploy/v1 service_config: clouddeploy_v1.yaml @@ -1614,7 +1614,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-developerconnect version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/developerconnect/v1 service_config: developerconnect_v1.yaml @@ -1633,7 +1633,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-devicestreaming version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/devicestreaming/v1 service_config: devicestreaming_v1.yaml @@ -1652,7 +1652,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-dialogflow version: 2.42.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/dialogflow/v2beta1 service_config: dialogflow_v2beta1.yaml @@ -1673,7 +1673,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-discoveryengine version: 0.14.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/discoveryengine/v1 service_config: discoveryengine_v1.yaml @@ -1696,7 +1696,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-dlp version: 3.33.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/privacy/dlp/v2 service_config: dlp_v2.yaml @@ -1715,7 +1715,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-dms version: 1.13.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/clouddms/v1 service_config: datamigration_v1.yaml @@ -1734,7 +1734,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-documentai version: 3.7.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/documentai/v1beta3 service_config: documentai_v1beta3.yaml @@ -1755,7 +1755,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-domains version: 1.11.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/domains/v1beta1 service_config: domains_v1beta1.yaml @@ -1776,7 +1776,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-edgecontainer version: 0.6.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/edgecontainer/v1 service_config: edgecontainer_v1.yaml @@ -1795,7 +1795,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-edgenetwork version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/edgenetwork/v1 service_config: edgenetwork_v1.yaml @@ -1814,7 +1814,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-enterpriseknowledgegraph version: 0.4.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/enterpriseknowledgegraph/v1 service_config: enterpriseknowledgegraph_v1.yaml @@ -1833,7 +1833,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-essential-contacts version: 1.11.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/essentialcontacts/v1 service_config: essentialcontacts_v1.yaml @@ -1852,7 +1852,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-eventarc version: 1.17.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/eventarc/v1 service_config: eventarc_v1.yaml @@ -1871,7 +1871,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-eventarc-publishing version: 0.8.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/eventarc/publishing/v1 service_config: eventarcpublishing_v1.yaml @@ -1890,7 +1890,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-filestore version: 1.14.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/filestore/v1 service_config: file_v1.yaml @@ -1909,7 +1909,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-financialservices version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/financialservices/v1 service_config: financialservices_v1.yaml @@ -1928,7 +1928,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-functions version: 1.21.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/functions/v2 service_config: cloudfunctions_v2.yaml @@ -1949,7 +1949,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-gdchardwaremanagement version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/gdchardwaremanagement/v1alpha service_config: gdchardwaremanagement_v1alpha.yaml @@ -1968,7 +1968,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-geminidataanalytics version: 0.5.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/geminidataanalytics/v1beta service_config: geminidataanalytics_v1beta.yaml @@ -1989,7 +1989,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-gke-backup version: 0.6.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/gkebackup/v1 service_config: gkebackup_v1.yaml @@ -2008,7 +2008,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-gke-connect-gateway version: 0.11.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/gkeconnect/gateway/v1beta1 service_config: connectgateway_v1beta1.yaml @@ -2029,12 +2029,12 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-gke-hub version: 1.19.0 - last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/gkehub/v1 - service_config: "" + service_config: gkehub_v1.yaml - path: google/cloud/gkehub/v1beta1 - service_config: "" + service_config: gkehub_v1beta1.yaml source_roots: - packages/google-cloud-gke-hub preserve_regex: @@ -2054,10 +2054,10 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-gke-multicloud version: 0.6.22 - last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/gkemulticloud/v1 - service_config: "" + service_config: gkemulticloud_v1.yaml source_roots: - packages/google-cloud-gke-multicloud preserve_regex: @@ -2073,10 +2073,10 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-gsuiteaddons version: 0.3.18 - last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/gsuiteaddons/v1 - service_config: "" + service_config: gsuiteaddons_v1.yaml source_roots: - packages/google-cloud-gsuiteaddons preserve_regex: @@ -2092,20 +2092,20 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-iam version: 2.20.0 - last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/iam/v3 - service_config: "" + service_config: iam_v3.yaml - path: google/iam/v3beta - service_config: "" + service_config: iam_v3beta.yaml - path: google/iam/admin/v1 - service_config: "" + service_config: iam.yaml - path: google/iam/v2 - service_config: "" + service_config: iam_v2.yaml - path: google/iam/credentials/v1 - service_config: "" + service_config: iamcredentials_v1.yaml - path: google/iam/v2beta - service_config: "" + service_config: iam_v2beta.yaml source_roots: - packages/google-cloud-iam preserve_regex: @@ -2121,7 +2121,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-iam-logging version: 1.5.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/iam/v1/logging service_config: "" @@ -2141,7 +2141,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-iap version: 1.18.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/iap/v1 service_config: iap_v1.yaml @@ -2160,7 +2160,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-ids version: 1.11.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/ids/v1 service_config: ids_v1.yaml @@ -2179,7 +2179,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-kms version: 3.7.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/kms/v1 service_config: cloudkms_v1.yaml @@ -2198,7 +2198,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-kms-inventory version: 0.3.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/kms/inventory/v1 service_config: kmsinventory_v1.yaml @@ -2217,7 +2217,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-language version: 2.18.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/language/v1 service_config: language_v1.yaml @@ -2240,7 +2240,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-licensemanager version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/licensemanager/v1 service_config: licensemanager_v1.yaml @@ -2259,7 +2259,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-life-sciences version: 0.10.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/lifesciences/v2beta service_config: lifesciences_v2beta.yaml @@ -2278,7 +2278,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-locationfinder version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/locationfinder/v1 service_config: cloudlocationfinder_v1.yaml @@ -2297,7 +2297,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-lustre version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/lustre/v1 service_config: lustre_v1.yaml @@ -2316,7 +2316,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-maintenance-api version: 0.1.1 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/maintenance/api/v1beta service_config: maintenance_v1beta.yaml @@ -2335,7 +2335,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-managed-identities version: 1.12.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/managedidentities/v1 service_config: managedidentities_v1.yaml @@ -2354,7 +2354,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-managedkafka version: 0.1.12 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/managedkafka/v1 service_config: managedkafka_v1.yaml @@ -2373,7 +2373,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-managedkafka-schemaregistry version: 0.1.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/managedkafka/schemaregistry/v1 service_config: managedkafka_v1.yaml @@ -2392,7 +2392,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-media-translation version: 0.11.17 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/mediatranslation/v1beta1 service_config: mediatranslation_v1beta1.yaml @@ -2411,7 +2411,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-memcache version: 1.12.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/memcache/v1 service_config: memcache_v1.yaml @@ -2432,7 +2432,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-memorystore version: 0.1.3 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/memorystore/v1beta service_config: memorystore_v1beta.yaml @@ -2453,7 +2453,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-migrationcenter version: 0.1.15 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/migrationcenter/v1 service_config: migrationcenter_v1.yaml @@ -2472,7 +2472,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-modelarmor version: 0.2.8 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/modelarmor/v1beta service_config: modelarmor_v1beta.yaml @@ -2493,7 +2493,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-monitoring version: 2.28.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/monitoring/v3 service_config: monitoring.yaml @@ -2517,10 +2517,10 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-monitoring-dashboards version: 2.19.0 - last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/monitoring/dashboard/v1 - service_config: "" + service_config: monitoring.yaml source_roots: - packages/google-cloud-monitoring-dashboards preserve_regex: @@ -2538,7 +2538,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-monitoring-metrics-scopes version: 1.9.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/monitoring/metricsscope/v1 service_config: monitoring.yaml @@ -2557,7 +2557,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-netapp version: 0.3.24 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/netapp/v1 service_config: netapp_v1.yaml @@ -2576,7 +2576,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-network-connectivity version: 2.10.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/networkconnectivity/v1 service_config: networkconnectivity_v1.yaml @@ -2597,7 +2597,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-network-management version: 1.28.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/networkmanagement/v1 service_config: networkmanagement_v1.yaml @@ -2616,14 +2616,14 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-network-security version: 0.9.21 - last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/networksecurity/v1alpha1 - service_config: "" + service_config: networksecurity_v1alpha1.yaml - path: google/cloud/networksecurity/v1beta1 - service_config: "" + service_config: networksecurity_v1beta1.yaml - path: google/cloud/networksecurity/v1 - service_config: "" + service_config: networksecurity_v1.yaml source_roots: - packages/google-cloud-network-security preserve_regex: @@ -2639,7 +2639,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-network-services version: 0.5.24 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/networkservices/v1 service_config: networkservices_v1.yaml @@ -2658,7 +2658,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-notebooks version: 1.13.3 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/notebooks/v1beta1 service_config: notebooks_v1beta1.yaml @@ -2681,7 +2681,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-optimization version: 1.11.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/optimization/v1 service_config: cloudoptimization_v1.yaml @@ -2700,7 +2700,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-oracledatabase version: 0.1.10 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/oracledatabase/v1 service_config: oracledatabase_v1.yaml @@ -2719,7 +2719,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-orchestration-airflow version: 1.17.5 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/orchestration/airflow/service/v1 service_config: composer_v1.yaml @@ -2740,7 +2740,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-os-config version: 1.21.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/osconfig/v1alpha service_config: osconfig_v1alpha.yaml @@ -2761,10 +2761,10 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-os-login version: 2.18.0 - last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/oslogin/v1 - service_config: "" + service_config: oslogin_v1.yaml source_roots: - packages/google-cloud-os-login preserve_regex: @@ -2782,7 +2782,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-parallelstore version: 0.2.15 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/parallelstore/v1 service_config: parallelstore_v1.yaml @@ -2803,7 +2803,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-parametermanager version: 0.1.5 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/parametermanager/v1 service_config: parametermanager_v1.yaml @@ -2822,7 +2822,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-phishing-protection version: 1.14.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/phishingprotection/v1beta1 service_config: phishingprotection_v1beta1.yaml @@ -2841,7 +2841,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-policy-troubleshooter version: 1.13.3 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/policytroubleshooter/v1 service_config: policytroubleshooter_v1.yaml @@ -2860,7 +2860,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-policysimulator version: 0.1.15 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/policysimulator/v1 service_config: policysimulator_v1.yaml @@ -2879,7 +2879,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-policytroubleshooter-iam version: 0.1.13 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/policytroubleshooter/iam/v3 service_config: policytroubleshooter_v3.yaml @@ -2898,7 +2898,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-private-ca version: 1.15.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/security/privateca/v1 service_config: privateca_v1.yaml @@ -2919,7 +2919,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-private-catalog version: 0.9.18 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/privatecatalog/v1beta1 service_config: cloudprivatecatalog_v1beta1.yaml @@ -2938,7 +2938,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-privilegedaccessmanager version: 0.1.9 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/privilegedaccessmanager/v1 service_config: privilegedaccessmanager_v1.yaml @@ -2957,7 +2957,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-quotas version: 0.1.18 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/api/cloudquotas/v1 service_config: cloudquotas_v1.yaml @@ -2978,7 +2978,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-rapidmigrationassessment version: 0.1.16 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/rapidmigrationassessment/v1 service_config: rapidmigrationassessment_v1.yaml @@ -2997,7 +2997,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-recaptcha-enterprise version: 1.28.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/recaptchaenterprise/v1 service_config: recaptchaenterprise_v1.yaml @@ -3016,7 +3016,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-recommendations-ai version: 0.10.18 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/recommendationengine/v1beta1 service_config: recommendationengine_v1beta1.yaml @@ -3035,7 +3035,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-recommender version: 2.18.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/recommender/v1beta1 service_config: recommender_v1beta1.yaml @@ -3056,7 +3056,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-redis version: 2.18.1 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/redis/v1 service_config: redis_v1.yaml @@ -3077,7 +3077,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-redis-cluster version: 0.1.15 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/redis/cluster/v1 service_config: redis_v1.yaml @@ -3098,7 +3098,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-resource-manager version: 1.14.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/resourcemanager/v3 service_config: cloudresourcemanager_v3.yaml @@ -3117,7 +3117,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-retail version: 2.6.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/retail/v2 service_config: retail_v2.yaml @@ -3140,7 +3140,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-run version: 0.11.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/run/v2 service_config: run_v2.yaml @@ -3159,7 +3159,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-saasplatform-saasservicemgmt version: 0.1.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/saasplatform/saasservicemgmt/v1beta1 service_config: saasservicemgmt_v1beta1.yaml @@ -3178,7 +3178,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-scheduler version: 2.16.1 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/scheduler/v1 service_config: cloudscheduler_v1.yaml @@ -3199,14 +3199,14 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-secret-manager version: 2.25.0 - last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/secretmanager/v1 - service_config: "" + service_config: secretmanager_v1.yaml - path: google/cloud/secretmanager/v1beta2 - service_config: "" + service_config: secretmanager_v1beta2.yaml - path: google/cloud/secrets/v1beta1 - service_config: "" + service_config: secretmanager_v1beta1.yaml source_roots: - packages/google-cloud-secret-manager preserve_regex: @@ -3222,7 +3222,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-securesourcemanager version: 0.1.17 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/securesourcemanager/v1 service_config: securesourcemanager_v1.yaml @@ -3241,7 +3241,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-security-publicca version: 0.3.18 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/security/publicca/v1 service_config: publicca_v1.yaml @@ -3262,7 +3262,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-securitycenter version: 1.40.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/securitycenter/v2 service_config: securitycenter_v2.yaml @@ -3287,7 +3287,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-securitycentermanagement version: 0.1.22 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/securitycentermanagement/v1 service_config: securitycentermanagement_v1.yaml @@ -3306,7 +3306,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-service-control version: 1.16.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/api/servicecontrol/v2 service_config: servicecontrol.yaml @@ -3327,7 +3327,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-service-directory version: 1.14.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/servicedirectory/v1 service_config: servicedirectory_v1.yaml @@ -3348,7 +3348,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-service-management version: 1.13.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/api/servicemanagement/v1 service_config: servicemanagement_v1.yaml @@ -3367,7 +3367,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-service-usage version: 1.13.1 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/api/serviceusage/v1 service_config: serviceusage_v1.yaml @@ -3386,7 +3386,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-servicehealth version: 0.1.12 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/servicehealth/v1 service_config: servicehealth_v1.yaml @@ -3405,7 +3405,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-shell version: 1.12.1 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/shell/v1 service_config: cloudshell_v1.yaml @@ -3424,7 +3424,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-source-context version: 1.7.1 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/devtools/source/v1 service_config: "" @@ -3444,7 +3444,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-speech version: 2.33.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/speech/v1 service_config: speech_v1.yaml @@ -3469,7 +3469,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-storage-control version: 1.7.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/storage/control/v2 service_config: storage_v2.yaml @@ -3488,7 +3488,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-storage-transfer version: 1.17.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/storagetransfer/v1 service_config: storagetransfer_v1.yaml @@ -3507,7 +3507,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-storagebatchoperations version: 0.1.3 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/storagebatchoperations/v1 service_config: storagebatchoperations_v1.yaml @@ -3526,7 +3526,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-storageinsights version: 0.1.16 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/storageinsights/v1 service_config: storageinsights_v1.yaml @@ -3545,7 +3545,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-support version: 0.1.19 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/support/v2beta service_config: cloudsupport_v2beta.yaml @@ -3566,7 +3566,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-talent version: 2.17.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/talent/v4beta1 service_config: jobs_v4beta1.yaml @@ -3587,7 +3587,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-tasks version: 2.19.3 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/tasks/v2beta2 service_config: cloudtasks_v2beta2.yaml @@ -3611,7 +3611,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-telcoautomation version: 0.2.11 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/telcoautomation/v1 service_config: telcoautomation_v1.yaml @@ -3633,7 +3633,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-texttospeech version: 2.31.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/texttospeech/v1 service_config: texttospeech_v1.yaml @@ -3654,7 +3654,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-tpu version: 1.23.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/tpu/v2alpha1 service_config: tpu_v2alpha1.yaml @@ -3677,7 +3677,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-trace version: 1.16.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/devtools/cloudtrace/v2 service_config: cloudtrace_v2.yaml @@ -3698,7 +3698,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-translate version: 3.21.1 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/translate/v3beta1 service_config: translate_v3beta1.yaml @@ -3723,7 +3723,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-video-live-stream version: 1.13.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/video/livestream/v1 service_config: livestream_v1.yaml @@ -3742,7 +3742,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-video-stitcher version: 0.8.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/video/stitcher/v1 service_config: videostitcher_v1.yaml @@ -3761,7 +3761,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-video-transcoder version: 1.17.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/video/transcoder/v1 service_config: transcoder_v1.yaml @@ -3780,7 +3780,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-videointelligence version: 2.16.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/videointelligence/v1p3beta1 service_config: videointelligence_v1p3beta1.yaml @@ -3807,7 +3807,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-vision version: 3.10.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/vision/v1p3beta1 service_config: vision_v1p3beta1.yaml @@ -3837,7 +3837,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-visionai version: 0.1.10 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/visionai/v1alpha1 service_config: visionai_v1alpha1.yaml @@ -3858,7 +3858,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-vm-migration version: 1.12.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/vmmigration/v1 service_config: vmmigration_v1.yaml @@ -3877,7 +3877,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-vmwareengine version: 1.8.3 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/vmwareengine/v1 service_config: vmwareengine_v1.yaml @@ -3896,7 +3896,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-vpc-access version: 1.13.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/vpcaccess/v1 service_config: vpcaccess_v1.yaml @@ -3915,7 +3915,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-webrisk version: 1.18.1 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/webrisk/v1beta1 service_config: webrisk_v1beta1.yaml @@ -3936,7 +3936,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-websecurityscanner version: 1.17.3 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/websecurityscanner/v1alpha service_config: websecurityscanner_v1alpha.yaml @@ -3959,7 +3959,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-workflows version: 1.18.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/workflows/executions/v1 service_config: workflowexecutions_v1.yaml @@ -3984,7 +3984,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-workstations version: 0.5.15 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/cloud/workstations/v1beta service_config: workstations_v1beta.yaml @@ -4005,7 +4005,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-geo-type version: 0.3.13 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/geo/type service_config: type_geo.yaml @@ -4025,7 +4025,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-maps-addressvalidation version: 0.3.20 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/maps/addressvalidation/v1 service_config: addressvalidation_v1.yaml @@ -4044,7 +4044,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-maps-areainsights version: 0.1.8 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/maps/areainsights/v1 service_config: areainsights_v1.yaml @@ -4063,7 +4063,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-maps-fleetengine version: 0.2.11 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/maps/fleetengine/v1 service_config: fleetengine_v1.yaml @@ -4082,7 +4082,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-maps-fleetengine-delivery version: 0.2.13 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/maps/fleetengine/delivery/v1 service_config: fleetengine_v1.yaml @@ -4101,7 +4101,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-maps-mapsplatformdatasets version: 0.4.8 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/maps/mapsplatformdatasets/v1 service_config: mapsplatformdatasets_v1.yaml @@ -4120,7 +4120,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-maps-places version: 0.2.2 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/maps/places/v1 service_config: places_v1.yaml @@ -4139,7 +4139,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-maps-routeoptimization version: 0.1.11 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/maps/routeoptimization/v1 service_config: routeoptimization_v1.yaml @@ -4159,7 +4159,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-maps-routing version: 0.6.16 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/maps/routing/v2 service_config: routes_v2.yaml @@ -4178,7 +4178,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-maps-solar version: 0.1.9 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/maps/solar/v1 service_config: solar_v1.yaml @@ -4197,7 +4197,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-css version: 0.1.17 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/css/v1 service_config: css_v1.yaml @@ -4216,7 +4216,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-accounts version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/accounts/v1 service_config: merchantapi_v1.yaml @@ -4237,7 +4237,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-conversions version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/conversions/v1 service_config: merchantapi_v1.yaml @@ -4258,7 +4258,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-datasources version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/datasources/v1 service_config: merchantapi_v1.yaml @@ -4279,7 +4279,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-inventories version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/inventories/v1beta service_config: merchantapi_v1beta.yaml @@ -4300,7 +4300,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-issueresolution version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/issueresolution/v1 service_config: merchantapi_v1.yaml @@ -4321,7 +4321,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-lfp version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/lfp/v1beta service_config: merchantapi_v1beta.yaml @@ -4342,7 +4342,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-notifications version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/notifications/v1 service_config: merchantapi_v1.yaml @@ -4363,7 +4363,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-ordertracking version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/ordertracking/v1 service_config: merchantapi_v1.yaml @@ -4384,7 +4384,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-products version: 1.1.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/products/v1 service_config: merchantapi_v1.yaml @@ -4405,7 +4405,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-productstudio version: 0.1.1 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/productstudio/v1alpha service_config: merchantapi_v1alpha.yaml @@ -4424,7 +4424,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-promotions version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/promotions/v1 service_config: merchantapi_v1.yaml @@ -4445,7 +4445,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-quota version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/quota/v1beta service_config: merchantapi_v1beta.yaml @@ -4466,7 +4466,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-reports version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/reports/v1beta service_config: merchantapi_v1beta.yaml @@ -4489,7 +4489,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-merchant-reviews version: 0.2.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/merchant/reviews/v1beta service_config: merchantapi_v1beta.yaml @@ -4508,7 +4508,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-shopping-type version: 1.0.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/shopping/type service_config: "" @@ -4528,7 +4528,7 @@ libraries: tag_format: '{id}-v{version}' - id: googleapis-common-protos version: 1.70.0 - last_generated_commit: a9ebc23947a515fab3de97ff326c86fc8f03fae1 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: google/api service_config: serviceconfig.yaml @@ -4550,10 +4550,10 @@ libraries: tag_format: '{id}-v{version}' - id: grafeas version: 1.16.0 - last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 + last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd apis: - path: grafeas/v1 - service_config: "" + service_config: grafeas_v1.yaml source_roots: - packages/grafeas preserve_regex: @@ -4575,7 +4575,7 @@ libraries: last_generated_commit: d300b151a973ce0425ae4ad07b3de957ca31bec6 apis: - path: google/iam/v1 - service_config: "" + service_config: iam_meta_api.yaml source_roots: - packages/grpc-google-iam-v1/ preserve_regex: [] diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage/__init__.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage/__init__.py index 2e0eb28f8d81..fe4c2375268f 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage/__init__.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage/__init__.py @@ -97,6 +97,8 @@ FunctionCallingConfig, FunctionDeclaration, FunctionResponse, + FunctionResponseBlob, + FunctionResponsePart, GoogleSearchRetrieval, GroundingPassage, GroundingPassages, @@ -163,6 +165,7 @@ GroundingChunk, GroundingMetadata, GroundingSupport, + ImageConfig, LogprobsResult, MultiSpeakerVoiceConfig, PrebuiltVoiceConfig, @@ -207,8 +210,8 @@ UpdatePermissionRequest, ) from google.ai.generativelanguage_v1beta.types.prediction_service import ( - GenerateVideoResponse, Media, + PredictLongRunningGeneratedVideoResponse, PredictLongRunningMetadata, PredictLongRunningRequest, PredictLongRunningResponse, @@ -326,6 +329,8 @@ "FunctionCallingConfig", "FunctionDeclaration", "FunctionResponse", + "FunctionResponseBlob", + "FunctionResponsePart", "GoogleSearchRetrieval", "GroundingPassage", "GroundingPassages", @@ -387,6 +392,7 @@ "GroundingChunk", "GroundingMetadata", "GroundingSupport", + "ImageConfig", "LogprobsResult", "MultiSpeakerVoiceConfig", "PrebuiltVoiceConfig", @@ -425,8 +431,8 @@ "TransferOwnershipRequest", "TransferOwnershipResponse", "UpdatePermissionRequest", - "GenerateVideoResponse", "Media", + "PredictLongRunningGeneratedVideoResponse", "PredictLongRunningMetadata", "PredictLongRunningRequest", "PredictLongRunningResponse", diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/async_client.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/async_client.py index 3e45acb1ff5f..bdd04db63b84 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/async_client.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/async_client.py @@ -349,7 +349,7 @@ async def sample_generate_content(): Args: request (Optional[Union[google.ai.generativelanguage_v1.types.GenerateContentRequest, dict]]): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 model (:class:`str`): Required. The name of the ``Model`` to use for generating the completion. @@ -493,7 +493,7 @@ async def sample_stream_generate_content(): Args: request (Optional[Union[google.ai.generativelanguage_v1.types.GenerateContentRequest, dict]]): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 model (:class:`str`): Required. The name of the ``Model`` to use for generating the completion. diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/client.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/client.py index 192ca0f505a4..cc900ae7f474 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/client.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/client.py @@ -765,7 +765,7 @@ def sample_generate_content(): Args: request (Union[google.ai.generativelanguage_v1.types.GenerateContentRequest, dict]): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 model (str): Required. The name of the ``Model`` to use for generating the completion. @@ -906,7 +906,7 @@ def sample_stream_generate_content(): Args: request (Union[google.ai.generativelanguage_v1.types.GenerateContentRequest, dict]): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 model (str): Required. The name of the ``Model`` to use for generating the completion. diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/transports/rest.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/transports/rest.py index b2c3671e4d67..e289efb1ae59 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/transports/rest.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/transports/rest.py @@ -1071,7 +1071,7 @@ def __call__( Args: request (~.generative_service.GenerateContentRequest): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1244,7 +1244,7 @@ def __call__( Args: request (~.generative_service.GenerateContentRequest): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/transports/rest_base.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/transports/rest_base.py index e78404b703bf..45b19bc1a7d6 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/transports/rest_base.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/generative_service/transports/rest_base.py @@ -484,6 +484,14 @@ def _get_http_options(): "method": "get", "uri": "/v1/{name=corpora/*/operations/*}", }, + { + "method": "get", + "uri": "/v1/{name=ragStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=ragStores/*/upload/operations/*}", + }, ] return http_options diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/model_service/transports/rest_base.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/model_service/transports/rest_base.py index ffcfb5d8745b..b4ee34bd2693 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/model_service/transports/rest_base.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/services/model_service/transports/rest_base.py @@ -258,6 +258,14 @@ def _get_http_options(): "method": "get", "uri": "/v1/{name=corpora/*/operations/*}", }, + { + "method": "get", + "uri": "/v1/{name=ragStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=ragStores/*/upload/operations/*}", + }, ] return http_options diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/types/generative_service.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/types/generative_service.py index 497c3208972f..684f0ef64b38 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/types/generative_service.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/types/generative_service.py @@ -17,6 +17,7 @@ from typing import MutableMapping, MutableSequence +from google.protobuf import struct_pb2 # type: ignore import proto # type: ignore from google.ai.generativelanguage_v1.types import citation @@ -96,6 +97,8 @@ class TaskType(proto.Enum): class GenerateContentRequest(proto.Message): r"""Request to generate a completion from the model. + NEXT ID: 18 + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -170,6 +173,7 @@ class GenerateContentRequest(proto.Message): class GenerationConfig(proto.Message): r"""Configuration options for model generation and outputs. Not all parameters are configurable for every model. + Next ID: 29 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -246,6 +250,9 @@ class GenerationConfig(proto.Message): the request uses a randomly generated seed. This field is a member of `oneof`_ ``_seed``. + response_json_schema_ordered (google.protobuf.struct_pb2.Value): + Optional. An internal detail. Use ``responseJsonSchema`` + rather than this field. presence_penalty (float): Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. @@ -296,6 +303,7 @@ class GenerationConfig(proto.Message): This sets the number of top logprobs to return at each decoding step in the [Candidate.logprobs_result][google.ai.generativelanguage.v1.Candidate.logprobs_result]. + The number must be in the range of [0, 20]. This field is a member of `oneof`_ ``_logprobs``. enable_enhanced_civic_answers (bool): @@ -339,6 +347,11 @@ class GenerationConfig(proto.Message): number=8, optional=True, ) + response_json_schema_ordered: struct_pb2.Value = proto.Field( + proto.MESSAGE, + number=28, + message=struct_pb2.Value, + ) presence_penalty: float = proto.Field( proto.FLOAT, number=15, @@ -576,6 +589,12 @@ class Candidate(proto.Message): model stopped generating tokens. If empty, the model has not stopped generating tokens. + finish_message (str): + Optional. Output only. Details the reason why the model + stopped generating tokens. This is populated only when + ``finish_reason`` is set. + + This field is a member of `oneof`_ ``_finish_message``. safety_ratings (MutableSequence[google.ai.generativelanguage_v1.types.SafetyRating]): List of ratings for the safety of a response candidate. @@ -644,9 +663,21 @@ class FinishReason(proto.Enum): IMAGE_SAFETY (11): Token generation stopped because generated images contain safety violations. + IMAGE_PROHIBITED_CONTENT (14): + Image generation stopped because generated + images has other prohibited content. + IMAGE_OTHER (15): + Image generation stopped because of other + miscellaneous issue. + NO_IMAGE (16): + The model was expected to generate an image, + but none was generated. UNEXPECTED_TOOL_CALL (12): Model generated a tool call but no tools were enabled in the request. + TOO_MANY_TOOL_CALLS (13): + Model called too many tools consecutively, + thus the system exited execution. """ FINISH_REASON_UNSPECIFIED = 0 STOP = 1 @@ -660,7 +691,11 @@ class FinishReason(proto.Enum): SPII = 9 MALFORMED_FUNCTION_CALL = 10 IMAGE_SAFETY = 11 + IMAGE_PROHIBITED_CONTENT = 14 + IMAGE_OTHER = 15 + NO_IMAGE = 16 UNEXPECTED_TOOL_CALL = 12 + TOO_MANY_TOOL_CALLS = 13 index: int = proto.Field( proto.INT32, @@ -677,6 +712,11 @@ class FinishReason(proto.Enum): number=2, enum=FinishReason, ) + finish_message: str = proto.Field( + proto.STRING, + number=4, + optional=True, + ) safety_ratings: MutableSequence[safety.SafetyRating] = proto.RepeatedField( proto.MESSAGE, number=5, @@ -747,10 +787,18 @@ class UrlRetrievalStatus(proto.Enum): Url retrieval is successful. URL_RETRIEVAL_STATUS_ERROR (2): Url retrieval is failed due to error. + URL_RETRIEVAL_STATUS_PAYWALL (3): + Url retrieval is failed because the content + is behind paywall. + URL_RETRIEVAL_STATUS_UNSAFE (4): + Url retrieval is failed because the content + is unsafe. """ URL_RETRIEVAL_STATUS_UNSPECIFIED = 0 URL_RETRIEVAL_STATUS_SUCCESS = 1 URL_RETRIEVAL_STATUS_ERROR = 2 + URL_RETRIEVAL_STATUS_PAYWALL = 3 + URL_RETRIEVAL_STATUS_UNSAFE = 4 retrieved_url: str = proto.Field( proto.STRING, @@ -766,7 +814,13 @@ class UrlRetrievalStatus(proto.Enum): class LogprobsResult(proto.Message): r"""Logprobs Result + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: + log_probability_sum (float): + Sum of log probabilities for all tokens. + + This field is a member of `oneof`_ ``_log_probability_sum``. top_candidates (MutableSequence[google.ai.generativelanguage_v1.types.LogprobsResult.TopCandidates]): Length = total number of decoding steps. chosen_candidates (MutableSequence[google.ai.generativelanguage_v1.types.LogprobsResult.Candidate]): @@ -825,6 +879,11 @@ class TopCandidates(proto.Message): message="LogprobsResult.Candidate", ) + log_probability_sum: float = proto.Field( + proto.FLOAT, + number=3, + optional=True, + ) top_candidates: MutableSequence[TopCandidates] = proto.RepeatedField( proto.MESSAGE, number=1, diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/types/safety.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/types/safety.py index 1ae75d246694..3ee9897b889f 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/types/safety.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1/types/safety.py @@ -64,7 +64,8 @@ class HarmCategory(proto.Enum): **Gemini** - Dangerous content. HARM_CATEGORY_CIVIC_INTEGRITY (11): **Gemini** - Content that may be used to harm civic - integrity. + integrity. DEPRECATED: use enable_enhanced_civic_answers + instead. """ HARM_CATEGORY_UNSPECIFIED = 0 HARM_CATEGORY_DEROGATORY = 1 diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/__init__.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/__init__.py index 12fe35b7feda..770f8ece652a 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/__init__.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/__init__.py @@ -61,6 +61,8 @@ FunctionCallingConfig, FunctionDeclaration, FunctionResponse, + FunctionResponseBlob, + FunctionResponsePart, GoogleSearchRetrieval, GroundingPassage, GroundingPassages, @@ -127,6 +129,7 @@ GroundingChunk, GroundingMetadata, GroundingSupport, + ImageConfig, LogprobsResult, MultiSpeakerVoiceConfig, PrebuiltVoiceConfig, @@ -171,8 +174,8 @@ UpdatePermissionRequest, ) from .types.prediction_service import ( - GenerateVideoResponse, Media, + PredictLongRunningGeneratedVideoResponse, PredictLongRunningMetadata, PredictLongRunningRequest, PredictLongRunningResponse, @@ -342,6 +345,8 @@ "FunctionCallingConfig", "FunctionDeclaration", "FunctionResponse", + "FunctionResponseBlob", + "FunctionResponsePart", "GenerateAnswerRequest", "GenerateAnswerResponse", "GenerateContentRequest", @@ -350,7 +355,6 @@ "GenerateMessageResponse", "GenerateTextRequest", "GenerateTextResponse", - "GenerateVideoResponse", "GenerationConfig", "GenerativeServiceClient", "GetCachedContentRequest", @@ -371,6 +375,7 @@ "GroundingSupport", "HarmCategory", "Hyperparameters", + "ImageConfig", "ListCachedContentsRequest", "ListCachedContentsResponse", "ListChunksRequest", @@ -401,6 +406,7 @@ "Permission", "PermissionServiceClient", "PrebuiltVoiceConfig", + "PredictLongRunningGeneratedVideoResponse", "PredictLongRunningMetadata", "PredictLongRunningRequest", "PredictLongRunningResponse", diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/async_client.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/async_client.py index 32e26bf6bbbf..f2234785408f 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/async_client.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/async_client.py @@ -354,7 +354,7 @@ async def sample_generate_content(): Args: request (Optional[Union[google.ai.generativelanguage_v1beta.types.GenerateContentRequest, dict]]): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 model (:class:`str`): Required. The name of the ``Model`` to use for generating the completion. @@ -674,7 +674,7 @@ async def sample_stream_generate_content(): Args: request (Optional[Union[google.ai.generativelanguage_v1beta.types.GenerateContentRequest, dict]]): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 model (:class:`str`): Required. The name of the ``Model`` to use for generating the completion. diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/client.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/client.py index ec5952997e05..1040f6d020a1 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/client.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/client.py @@ -781,7 +781,7 @@ def sample_generate_content(): Args: request (Union[google.ai.generativelanguage_v1beta.types.GenerateContentRequest, dict]): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 model (str): Required. The name of the ``Model`` to use for generating the completion. @@ -1095,7 +1095,7 @@ def sample_stream_generate_content(): Args: request (Union[google.ai.generativelanguage_v1beta.types.GenerateContentRequest, dict]): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 model (str): Required. The name of the ``Model`` to use for generating the completion. diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/transports/rest.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/transports/rest.py index ae4804cac76f..3fe27b870696 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/transports/rest.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/services/generative_service/transports/rest.py @@ -1306,7 +1306,7 @@ def __call__( Args: request (~.generative_service.GenerateContentRequest): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1479,7 +1479,7 @@ def __call__( Args: request (~.generative_service.GenerateContentRequest): The request object. Request to generate a completion from - the model. + the model. NEXT ID: 18 retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/__init__.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/__init__.py index 0c930707226e..2d63111dec1c 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/__init__.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/__init__.py @@ -35,6 +35,8 @@ FunctionCallingConfig, FunctionDeclaration, FunctionResponse, + FunctionResponseBlob, + FunctionResponsePart, GoogleSearchRetrieval, GroundingPassage, GroundingPassages, @@ -101,6 +103,7 @@ GroundingChunk, GroundingMetadata, GroundingSupport, + ImageConfig, LogprobsResult, MultiSpeakerVoiceConfig, PrebuiltVoiceConfig, @@ -145,8 +148,8 @@ UpdatePermissionRequest, ) from .prediction_service import ( - GenerateVideoResponse, Media, + PredictLongRunningGeneratedVideoResponse, PredictLongRunningMetadata, PredictLongRunningRequest, PredictLongRunningResponse, @@ -246,6 +249,8 @@ "FunctionCallingConfig", "FunctionDeclaration", "FunctionResponse", + "FunctionResponseBlob", + "FunctionResponsePart", "GoogleSearchRetrieval", "GroundingPassage", "GroundingPassages", @@ -307,6 +312,7 @@ "GroundingChunk", "GroundingMetadata", "GroundingSupport", + "ImageConfig", "LogprobsResult", "MultiSpeakerVoiceConfig", "PrebuiltVoiceConfig", @@ -345,8 +351,8 @@ "TransferOwnershipRequest", "TransferOwnershipResponse", "UpdatePermissionRequest", - "GenerateVideoResponse", "Media", + "PredictLongRunningGeneratedVideoResponse", "PredictLongRunningMetadata", "PredictLongRunningRequest", "PredictLongRunningResponse", diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/content.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/content.py index 9c651f864519..6d7f46657dd4 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/content.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/content.py @@ -29,7 +29,9 @@ "Modality", "Content", "Part", + "FunctionResponsePart", "Blob", + "FunctionResponseBlob", "FileData", "VideoMetadata", "ExecutableCode", @@ -206,6 +208,14 @@ class Part(proto.Message): thought_signature (bytes): Optional. An opaque signature for the thought so it can be reused in subsequent requests. + part_metadata (google.protobuf.struct_pb2.Struct): + Custom metadata associated with the Part. + Agents using genai.Part as content + representation may need to keep track of the + additional information. For example it can be + name of a file/source from which the Part + originates or a way to multiplex multiple Part + streams. """ text: str = proto.Field( @@ -263,6 +273,41 @@ class Part(proto.Message): proto.BYTES, number=13, ) + part_metadata: struct_pb2.Struct = proto.Field( + proto.MESSAGE, + number=8, + message=struct_pb2.Struct, + ) + + +class FunctionResponsePart(proto.Message): + r"""A datatype containing media that is part of a ``FunctionResponse`` + message. + + A ``FunctionResponsePart`` consists of data which has an associated + datatype. A ``FunctionResponsePart`` can only contain one of the + accepted types in ``FunctionResponsePart.data``. + + A ``FunctionResponsePart`` must have a fixed IANA MIME type + identifying the type and subtype of the media if the ``inline_data`` + field is filled with raw bytes. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + inline_data (google.ai.generativelanguage_v1beta.types.FunctionResponseBlob): + Inline media bytes. + + This field is a member of `oneof`_ ``data``. + """ + + inline_data: "FunctionResponseBlob" = proto.Field( + proto.MESSAGE, + number=1, + oneof="data", + message="FunctionResponseBlob", + ) class Blob(proto.Message): @@ -293,6 +338,35 @@ class Blob(proto.Message): ) +class FunctionResponseBlob(proto.Message): + r"""Raw media bytes for function response. + + Text should not be sent as raw bytes, use the + 'FunctionResponse.response' field. + + Attributes: + mime_type (str): + The IANA standard MIME type of the source data. Examples: + + - image/png + - image/jpeg If an unsupported MIME type is provided, an + error will be returned. For a complete list of supported + types, see `Supported file + formats `__. + data (bytes): + Raw bytes for media formats. + """ + + mime_type: str = proto.Field( + proto.STRING, + number=1, + ) + data: bytes = proto.Field( + proto.BYTES, + number=2, + ) + + class FileData(proto.Message): r"""URI based data. @@ -439,6 +513,8 @@ class Tool(proto.Message): with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. + Next ID: 12 + Attributes: function_declarations (MutableSequence[google.ai.generativelanguage_v1beta.types.FunctionDeclaration]): Optional. A list of ``FunctionDeclarations`` available to @@ -465,6 +541,11 @@ class Tool(proto.Message): Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. + computer_use (google.ai.generativelanguage_v1beta.types.Tool.ComputerUse): + Optional. Tool to support the model + interacting directly with the computer. If + enabled, it automatically populates computer-use + specific Function Declarations. url_context (google.ai.generativelanguage_v1beta.types.UrlContext): Optional. Tool to support URL context retrieval. @@ -487,6 +568,48 @@ class GoogleSearch(proto.Message): message=interval_pb2.Interval, ) + class ComputerUse(proto.Message): + r"""Computer Use tool type. + + Attributes: + environment (google.ai.generativelanguage_v1beta.types.Tool.ComputerUse.Environment): + Required. The environment being operated. + excluded_predefined_functions (MutableSequence[str]): + Optional. By default, predefined functions + are included in the final model call. Some of + them can be explicitly excluded from being + automatically included. This can serve two + purposes: + + 1. Using a more restricted / different action + space. + 2. Improving the definitions / instructions of + predefined functions. + """ + + class Environment(proto.Enum): + r"""Represents the environment being operated, such as a web + browser. + + Values: + ENVIRONMENT_UNSPECIFIED (0): + Defaults to browser. + ENVIRONMENT_BROWSER (1): + Operates in a web browser. + """ + ENVIRONMENT_UNSPECIFIED = 0 + ENVIRONMENT_BROWSER = 1 + + environment: "Tool.ComputerUse.Environment" = proto.Field( + proto.ENUM, + number=3, + enum="Tool.ComputerUse.Environment", + ) + excluded_predefined_functions: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=5, + ) + function_declarations: MutableSequence["FunctionDeclaration"] = proto.RepeatedField( proto.MESSAGE, number=1, @@ -507,6 +630,11 @@ class GoogleSearch(proto.Message): number=4, message=GoogleSearch, ) + computer_use: ComputerUse = proto.Field( + proto.MESSAGE, + number=6, + message=ComputerUse, + ) url_context: "UrlContext" = proto.Field( proto.MESSAGE, number=8, @@ -615,10 +743,10 @@ class FunctionCallingConfig(proto.Message): Optional. A set of function names that, when provided, limits the functions the model will call. - This should only be set when the Mode is ANY. Function names - should match [FunctionDeclaration.name]. With mode set to - ANY, model will predict a function call from the set of - function names provided. + This should only be set when the Mode is ANY or VALIDATED. + Function names should match [FunctionDeclaration.name]. When + set, model will predict a function call from only allowed + function names. """ class Mode(proto.Enum): @@ -644,10 +772,12 @@ class Mode(proto.Enum): Model behavior is same as when not passing any function declarations. VALIDATED (4): - Model decides to predict either a function - call or a natural language response, but will - validate function calls with constrained - decoding. + Model decides to predict either a function call or a natural + language response, but will validate function calls with + constrained decoding. If "allowed_function_names" are set, + the predicted function call will be limited to any one of + "allowed_function_names", else the predicted function call + will be any one of the provided "function_declarations". """ MODE_UNSPECIFIED = 0 AUTO = 1 @@ -680,8 +810,9 @@ class FunctionDeclaration(proto.Message): Attributes: name (str): Required. The name of the function. - Must be a-z, A-Z, 0-9, or contain underscores - and dashes, with a maximum length of 63. + Must be a-z, A-Z, 0-9, or contain underscores, + colons, dots, and dashes, with a maximum length + of 64. description (str): Required. A brief description of the function. @@ -813,7 +944,7 @@ class FunctionCall(proto.Message): name (str): Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores - and dashes, with a maximum length of 63. + and dashes, with a maximum length of 64. args (google.protobuf.struct_pb2.Struct): Optional. The function parameters and values in JSON object format. @@ -855,10 +986,18 @@ class FunctionResponse(proto.Message): name (str): Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores - and dashes, with a maximum length of 63. + and dashes, with a maximum length of 64. response (google.protobuf.struct_pb2.Struct): Required. The function response in JSON - object format. + object format. Callers can use any keys of their + choice that fit the function's syntax to return + the function output, e.g. "output", "result", + etc. In particular, if the function call failed + to execute, the response can have an "error" key + to return error details to the model. + parts (MutableSequence[google.ai.generativelanguage_v1beta.types.FunctionResponsePart]): + Optional. Ordered ``Parts`` that constitute a function + response. Parts may have different IANA MIME types. will_continue (bool): Optional. Signals that function call continues, and more responses will be returned, turning the function call into a @@ -915,6 +1054,11 @@ class Scheduling(proto.Enum): number=2, message=struct_pb2.Struct, ) + parts: MutableSequence["FunctionResponsePart"] = proto.RepeatedField( + proto.MESSAGE, + number=8, + message="FunctionResponsePart", + ) will_continue: bool = proto.Field( proto.BOOL, number=4, @@ -940,13 +1084,9 @@ class Schema(proto.Message): type_ (google.ai.generativelanguage_v1beta.types.Type): Required. Data type. format_ (str): - Optional. The format of the data. This is - used only for primitive datatypes. Supported - formats: - - for NUMBER type: float, double - for INTEGER type: int32, int64 - for STRING type: enum, date-time + Optional. The format of the data. Any value + is allowed, but most do not trigger any special + functionality. title (str): Optional. The title of the schema. description (str): diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/file.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/file.py index c5ae6e676658..f54e60868897 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/file.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/file.py @@ -113,10 +113,14 @@ class Source(proto.Enum): Indicates the file is uploaded by the user. GENERATED (2): Indicates the file is generated by Google. + REGISTERED (3): + Indicates the file is a registered, i.e. a + Google Cloud Storage file. """ SOURCE_UNSPECIFIED = 0 UPLOADED = 1 GENERATED = 2 + REGISTERED = 3 video_metadata: "VideoFileMetadata" = proto.Field( proto.MESSAGE, diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py index 47ed6c1a3e30..f7dae3c61e8a 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/generative_service.py @@ -36,6 +36,7 @@ "MultiSpeakerVoiceConfig", "SpeechConfig", "ThinkingConfig", + "ImageConfig", "GenerationConfig", "SemanticRetrieverConfig", "GenerateContentResponse", @@ -127,6 +128,8 @@ class TaskType(proto.Enum): class GenerateContentRequest(proto.Message): r"""Request to generate a completion from the model. + NEXT ID: 18 + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -397,9 +400,35 @@ class ThinkingConfig(proto.Message): ) +class ImageConfig(proto.Message): + r"""Config for image generation features. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + aspect_ratio (str): + Optional. The aspect ratio of the image to + generate. Supported aspect ratios: 1:1, 2:3, + 3:2, 3:4, 4:3, 9:16, 16:9, 21:9. + + If not specified, the model will choose a + default aspect ratio based on any reference + images provided. + + This field is a member of `oneof`_ ``_aspect_ratio``. + """ + + aspect_ratio: str = proto.Field( + proto.STRING, + number=1, + optional=True, + ) + + class GenerationConfig(proto.Message): r"""Configuration options for model generation and outputs. Not all parameters are configurable for every model. + Next ID: 29 .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -536,6 +565,9 @@ class GenerationConfig(proto.Message): (Nullable properties are not sufficient.) If ``$ref`` is set on a sub-schema, no other properties, except for than those starting as a ``$``, may be set. + response_json_schema_ordered (google.protobuf.struct_pb2.Value): + Optional. An internal detail. Use ``responseJsonSchema`` + rather than this field. presence_penalty (float): Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response. @@ -586,6 +618,7 @@ class GenerationConfig(proto.Message): This sets the number of top logprobs to return at each decoding step in the [Candidate.logprobs_result][google.ai.generativelanguage.v1beta.Candidate.logprobs_result]. + The number must be in the range of [0, 20]. This field is a member of `oneof`_ ``_logprobs``. enable_enhanced_civic_answers (bool): @@ -617,6 +650,13 @@ class GenerationConfig(proto.Message): for models that don't support thinking. This field is a member of `oneof`_ ``_thinking_config``. + image_config (google.ai.generativelanguage_v1beta.types.ImageConfig): + Optional. Config for image generation. + An error will be returned if this field is set + for models that don't support these config + options. + + This field is a member of `oneof`_ ``_image_config``. media_resolution (google.ai.generativelanguage_v1beta.types.GenerationConfig.MediaResolution): Optional. If specified, the media resolution specified will be used. @@ -709,6 +749,11 @@ class MediaResolution(proto.Enum): number=24, message=struct_pb2.Value, ) + response_json_schema_ordered: struct_pb2.Value = proto.Field( + proto.MESSAGE, + number=28, + message=struct_pb2.Value, + ) presence_penalty: float = proto.Field( proto.FLOAT, number=15, @@ -751,6 +796,12 @@ class MediaResolution(proto.Enum): optional=True, message="ThinkingConfig", ) + image_config: "ImageConfig" = proto.Field( + proto.MESSAGE, + number=27, + optional=True, + message="ImageConfig", + ) media_resolution: MediaResolution = proto.Field( proto.ENUM, number=23, @@ -1031,6 +1082,12 @@ class Candidate(proto.Message): model stopped generating tokens. If empty, the model has not stopped generating tokens. + finish_message (str): + Optional. Output only. Details the reason why the model + stopped generating tokens. This is populated only when + ``finish_reason`` is set. + + This field is a member of `oneof`_ ``_finish_message``. safety_ratings (MutableSequence[google.ai.generativelanguage_v1beta.types.SafetyRating]): List of ratings for the safety of a response candidate. @@ -1104,9 +1161,23 @@ class FinishReason(proto.Enum): IMAGE_SAFETY (11): Token generation stopped because generated images contain safety violations. + IMAGE_PROHIBITED_CONTENT (14): + Image generation stopped because generated + images has other prohibited content. + IMAGE_OTHER (15): + Image generation stopped because of other + miscellaneous issue. + NO_IMAGE (16): + The model was expected to generate an image, + but none was generated. + IMAGE_RECITATION (17): + Image generation stopped due to recitation. UNEXPECTED_TOOL_CALL (12): Model generated a tool call but no tools were enabled in the request. + TOO_MANY_TOOL_CALLS (13): + Model called too many tools consecutively, + thus the system exited execution. """ FINISH_REASON_UNSPECIFIED = 0 STOP = 1 @@ -1120,7 +1191,12 @@ class FinishReason(proto.Enum): SPII = 9 MALFORMED_FUNCTION_CALL = 10 IMAGE_SAFETY = 11 + IMAGE_PROHIBITED_CONTENT = 14 + IMAGE_OTHER = 15 + NO_IMAGE = 16 + IMAGE_RECITATION = 17 UNEXPECTED_TOOL_CALL = 12 + TOO_MANY_TOOL_CALLS = 13 index: int = proto.Field( proto.INT32, @@ -1137,6 +1213,11 @@ class FinishReason(proto.Enum): number=2, enum=FinishReason, ) + finish_message: str = proto.Field( + proto.STRING, + number=4, + optional=True, + ) safety_ratings: MutableSequence[safety.SafetyRating] = proto.RepeatedField( proto.MESSAGE, number=5, @@ -1214,10 +1295,18 @@ class UrlRetrievalStatus(proto.Enum): Url retrieval is successful. URL_RETRIEVAL_STATUS_ERROR (2): Url retrieval is failed due to error. + URL_RETRIEVAL_STATUS_PAYWALL (3): + Url retrieval is failed because the content + is behind paywall. + URL_RETRIEVAL_STATUS_UNSAFE (4): + Url retrieval is failed because the content + is unsafe. """ URL_RETRIEVAL_STATUS_UNSPECIFIED = 0 URL_RETRIEVAL_STATUS_SUCCESS = 1 URL_RETRIEVAL_STATUS_ERROR = 2 + URL_RETRIEVAL_STATUS_PAYWALL = 3 + URL_RETRIEVAL_STATUS_UNSAFE = 4 retrieved_url: str = proto.Field( proto.STRING, @@ -1233,7 +1322,13 @@ class UrlRetrievalStatus(proto.Enum): class LogprobsResult(proto.Message): r"""Logprobs Result + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: + log_probability_sum (float): + Sum of log probabilities for all tokens. + + This field is a member of `oneof`_ ``_log_probability_sum``. top_candidates (MutableSequence[google.ai.generativelanguage_v1beta.types.LogprobsResult.TopCandidates]): Length = total number of decoding steps. chosen_candidates (MutableSequence[google.ai.generativelanguage_v1beta.types.LogprobsResult.Candidate]): @@ -1292,6 +1387,11 @@ class TopCandidates(proto.Message): message="LogprobsResult.Candidate", ) + log_probability_sum: float = proto.Field( + proto.FLOAT, + number=3, + optional=True, + ) top_candidates: MutableSequence[TopCandidates] = proto.RepeatedField( proto.MESSAGE, number=1, @@ -2692,8 +2792,8 @@ class BidiGenerateContentClientMessage(proto.Message): Attributes: setup (google.ai.generativelanguage_v1beta.types.BidiGenerateContentSetup): - Optional. Session configuration sent in the - first and only first client message. + Optional. Session configuration sent only in + the first client message. This field is a member of `oneof`_ ``message_type``. client_content (google.ai.generativelanguage_v1beta.types.BidiGenerateContentClientContent): @@ -2804,6 +2904,11 @@ class BidiGenerateContentServerContent(proto.Message): transcripts close to the corresponding audio output. url_context_metadata (google.ai.generativelanguage_v1beta.types.UrlContextMetadata): + waiting_for_input (bool): + Output only. If true, indicates that the + model is not generating content because it is + waiting for more input from the user, e.g. + because it expects the user to continue talking. """ model_turn: gag_content.Content = proto.Field( @@ -2844,6 +2949,10 @@ class BidiGenerateContentServerContent(proto.Message): number=9, message="UrlContextMetadata", ) + waiting_for_input: bool = proto.Field( + proto.BOOL, + number=10, + ) class BidiGenerateContentToolCall(proto.Message): diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/prediction_service.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/prediction_service.py index dac9dea33c07..e4ec2aef8bf2 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/prediction_service.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/prediction_service.py @@ -30,7 +30,7 @@ "PredictLongRunningMetadata", "Media", "Video", - "GenerateVideoResponse", + "PredictLongRunningGeneratedVideoResponse", }, ) @@ -119,18 +119,18 @@ class PredictLongRunningResponse(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - generate_video_response (google.ai.generativelanguage_v1beta.types.GenerateVideoResponse): + generate_video_response (google.ai.generativelanguage_v1beta.types.PredictLongRunningGeneratedVideoResponse): The response of the video generation prediction. This field is a member of `oneof`_ ``response``. """ - generate_video_response: "GenerateVideoResponse" = proto.Field( + generate_video_response: "PredictLongRunningGeneratedVideoResponse" = proto.Field( proto.MESSAGE, number=1, oneof="response", - message="GenerateVideoResponse", + message="PredictLongRunningGeneratedVideoResponse", ) @@ -192,7 +192,7 @@ class Video(proto.Message): ) -class GenerateVideoResponse(proto.Message): +class PredictLongRunningGeneratedVideoResponse(proto.Message): r"""Veo response. Attributes: diff --git a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/safety.py b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/safety.py index 628428119989..19e1130e4089 100644 --- a/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/safety.py +++ b/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/safety.py @@ -66,7 +66,8 @@ class HarmCategory(proto.Enum): **Gemini** - Dangerous content. HARM_CATEGORY_CIVIC_INTEGRITY (11): **Gemini** - Content that may be used to harm civic - integrity. + integrity. DEPRECATED: use enable_enhanced_civic_answers + instead. """ HARM_CATEGORY_UNSPECIFIED = 0 HARM_CATEGORY_DEROGATORY = 1 diff --git a/packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1/test_generative_service.py b/packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1/test_generative_service.py index 588f40b9f587..f8862f1a5afc 100644 --- a/packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1/test_generative_service.py +++ b/packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1/test_generative_service.py @@ -53,6 +53,7 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore +from google.protobuf import struct_pb2 # type: ignore from google.ai.generativelanguage_v1.services.generative_service import ( GenerativeServiceAsyncClient, diff --git a/packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1beta/test_cache_service.py b/packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1beta/test_cache_service.py index e007f4e5a6c6..9a857da07bb6 100644 --- a/packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1beta/test_cache_service.py +++ b/packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1beta/test_cache_service.py @@ -4241,6 +4241,14 @@ def test_create_cached_content_rest_call_success(request_type): "id": "id_value", "name": "name_value", "response": {}, + "parts": [ + { + "inline_data": { + "mime_type": "mime_type_value", + "data": b"data_blob", + } + } + ], "will_continue": True, "scheduling": 1, }, @@ -4257,6 +4265,7 @@ def test_create_cached_content_rest_call_success(request_type): }, "thought": True, "thought_signature": b"thought_signature_blob", + "part_metadata": {}, } ], "role": "role_value", @@ -4315,6 +4324,13 @@ def test_create_cached_content_rest_call_success(request_type): "google_search": { "time_range_filter": {"start_time": {}, "end_time": {}} }, + "computer_use": { + "environment": 1, + "excluded_predefined_functions": [ + "excluded_predefined_functions_value1", + "excluded_predefined_functions_value2", + ], + }, "url_context": {}, } ], @@ -4688,6 +4704,14 @@ def test_update_cached_content_rest_call_success(request_type): "id": "id_value", "name": "name_value", "response": {}, + "parts": [ + { + "inline_data": { + "mime_type": "mime_type_value", + "data": b"data_blob", + } + } + ], "will_continue": True, "scheduling": 1, }, @@ -4704,6 +4728,7 @@ def test_update_cached_content_rest_call_success(request_type): }, "thought": True, "thought_signature": b"thought_signature_blob", + "part_metadata": {}, } ], "role": "role_value", @@ -4762,6 +4787,13 @@ def test_update_cached_content_rest_call_success(request_type): "google_search": { "time_range_filter": {"start_time": {}, "end_time": {}} }, + "computer_use": { + "environment": 1, + "excluded_predefined_functions": [ + "excluded_predefined_functions_value1", + "excluded_predefined_functions_value2", + ], + }, "url_context": {}, } ], diff --git a/packages/google-apps-card/google/apps/card/__init__.py b/packages/google-apps-card/google/apps/card/__init__.py index 292da70b6c6d..7334a3b4b4e8 100644 --- a/packages/google-apps-card/google/apps/card/__init__.py +++ b/packages/google-apps-card/google/apps/card/__init__.py @@ -24,6 +24,10 @@ Button, ButtonList, Card, + Carousel, + Chip, + ChipList, + CollapseControl, Columns, DateTimePicker, DecoratedText, @@ -36,10 +40,12 @@ MaterialIcon, OnClick, OpenLink, + OverflowMenu, SelectionInput, Suggestions, TextInput, TextParagraph, + Validation, Widget, ) @@ -49,6 +55,10 @@ "Button", "ButtonList", "Card", + "Carousel", + "Chip", + "ChipList", + "CollapseControl", "Columns", "DateTimePicker", "DecoratedText", @@ -61,9 +71,11 @@ "MaterialIcon", "OnClick", "OpenLink", + "OverflowMenu", "SelectionInput", "Suggestions", "TextInput", "TextParagraph", + "Validation", "Widget", ) diff --git a/packages/google-apps-card/google/apps/card_v1/__init__.py b/packages/google-apps-card/google/apps/card_v1/__init__.py index 727535e11b92..605f1714bd1d 100644 --- a/packages/google-apps-card/google/apps/card_v1/__init__.py +++ b/packages/google-apps-card/google/apps/card_v1/__init__.py @@ -24,6 +24,10 @@ Button, ButtonList, Card, + Carousel, + Chip, + ChipList, + CollapseControl, Columns, DateTimePicker, DecoratedText, @@ -36,10 +40,12 @@ MaterialIcon, OnClick, OpenLink, + OverflowMenu, SelectionInput, Suggestions, TextInput, TextParagraph, + Validation, Widget, ) @@ -49,6 +55,10 @@ "Button", "ButtonList", "Card", + "Carousel", + "Chip", + "ChipList", + "CollapseControl", "Columns", "DateTimePicker", "DecoratedText", @@ -61,9 +71,11 @@ "MaterialIcon", "OnClick", "OpenLink", + "OverflowMenu", "SelectionInput", "Suggestions", "TextInput", "TextParagraph", + "Validation", "Widget", ) diff --git a/packages/google-apps-card/google/apps/card_v1/types/__init__.py b/packages/google-apps-card/google/apps/card_v1/types/__init__.py index c667ff6b7b6c..7a9d7e731a38 100644 --- a/packages/google-apps-card/google/apps/card_v1/types/__init__.py +++ b/packages/google-apps-card/google/apps/card_v1/types/__init__.py @@ -19,6 +19,10 @@ Button, ButtonList, Card, + Carousel, + Chip, + ChipList, + CollapseControl, Columns, DateTimePicker, DecoratedText, @@ -31,10 +35,12 @@ MaterialIcon, OnClick, OpenLink, + OverflowMenu, SelectionInput, Suggestions, TextInput, TextParagraph, + Validation, Widget, ) @@ -44,6 +50,10 @@ "Button", "ButtonList", "Card", + "Carousel", + "Chip", + "ChipList", + "CollapseControl", "Columns", "DateTimePicker", "DecoratedText", @@ -56,9 +66,11 @@ "MaterialIcon", "OnClick", "OpenLink", + "OverflowMenu", "SelectionInput", "Suggestions", "TextInput", "TextParagraph", + "Validation", "Widget", ) diff --git a/packages/google-apps-card/google/apps/card_v1/types/card.py b/packages/google-apps-card/google/apps/card_v1/types/card.py index 2bb0718e3ce5..359b564f39e5 100644 --- a/packages/google-apps-card/google/apps/card_v1/types/card.py +++ b/packages/google-apps-card/google/apps/card_v1/types/card.py @@ -34,6 +34,7 @@ "ButtonList", "SelectionInput", "DateTimePicker", + "OverflowMenu", "Button", "Icon", "MaterialIcon", @@ -42,16 +43,21 @@ "ImageComponent", "Grid", "Columns", + "Carousel", + "CollapseControl", "OnClick", "OpenLink", "Action", + "Validation", + "ChipList", + "Chip", }, ) class Card(proto.Message): r"""A card interface displayed in a Google Chat message or Google - Workspace Add-on. + Workspace add-on. Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to present detailed @@ -64,9 +70,14 @@ class Card(proto.Message): - For Google Chat apps, see `Design the components of a card or dialog `__. - - For Google Workspace Add-ons, see `Card-based + - For Google Workspace add-ons, see `Card-based interfaces `__. + Note: You can add up to 100 widgets per card. Any widgets beyond + this limit are ignored. This limit applies to both card messages and + dialogs in Google Chat apps, and to cards in Google Workspace + add-ons. + **Example: Card message for a Google Chat app** |Example contact card| @@ -169,13 +180,14 @@ class Card(proto.Message): section of a card `__. section_divider_style (google.apps.card_v1.types.Card.DividerStyle): - The divider style between sections. + The divider style between the header, + sections and footer. card_actions (MutableSequence[google.apps.card_v1.types.Card.CardAction]): The card's actions. Actions are added to the card's toolbar menu. `Google Workspace - Add-ons `__: + add-ons `__: For example, the following JSON constructs a card action menu with ``Settings`` and ``Send Feedback`` options: @@ -212,7 +224,7 @@ class Card(proto.Message): navigation. `Google Workspace - Add-ons `__: + add-ons `__: fixed_footer (google.apps.card_v1.types.Card.CardFixedFooter): The fixed footer shown at the bottom of this card. @@ -223,49 +235,50 @@ class Card(proto.Message): but not `card messages `__. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: display_style (google.apps.card_v1.types.Card.DisplayStyle): - In Google Workspace Add-ons, sets the display properties of + In Google Workspace add-ons, sets the display properties of the ``peekCardHeader``. `Google Workspace - Add-ons `__: + add-ons `__: peek_card_header (google.apps.card_v1.types.Card.CardHeader): When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards. `Google Workspace - Add-ons `__: + add-ons `__: """ class DividerStyle(proto.Enum): r"""The divider style of a card. Currently only used for dividers betweens card sections. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Values: DIVIDER_STYLE_UNSPECIFIED (0): Don't use. Unspecified. SOLID_DIVIDER (1): - Default option. Render a solid divider - between sections. + Default option. Render a solid divider. NO_DIVIDER (2): - If set, no divider is rendered between - sections. + If set, no divider is rendered. This style + completely removes the divider from the layout. + The result is equivalent to not adding a divider + at all. """ DIVIDER_STYLE_UNSPECIFIED = 0 SOLID_DIVIDER = 1 NO_DIVIDER = 2 class DisplayStyle(proto.Enum): - r"""In Google Workspace Add-ons, determines how a card is displayed. + r"""In Google Workspace add-ons, determines how a card is displayed. `Google Workspace - Add-ons `__: + add-ons `__: Values: DISPLAY_STYLE_UNSPECIFIED (0): @@ -289,7 +302,7 @@ class CardHeader(proto.Message): `Add a header `__. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -305,7 +318,7 @@ class CardHeader(proto.Message): image_type (google.apps.card_v1.types.Widget.ImageType): The shape used to crop the image. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: image_url (str): The HTTPS URL of the image in the card @@ -341,7 +354,7 @@ class Section(proto.Message): r"""A section contains a collection of widgets that are rendered vertically in the order that they're specified. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -351,7 +364,7 @@ class Section(proto.Message): text, see `Formatting text in Google Chat apps `__ and `Formatting text in Google Workspace - Add-ons `__. + add-ons `__. widgets (MutableSequence[google.apps.card_v1.types.Widget]): All the widgets in the section. Must contain at least one widget. @@ -374,6 +387,11 @@ class Section(proto.Message): widgets are always shown and the last three are collapsed by default. The ``uncollapsibleWidgetsCount`` is taken into account only when ``collapsible`` is ``true``. + collapse_control (google.apps.card_v1.types.CollapseControl): + Optional. Define the expand and collapse + button of the section. This button will be shown + only if the section is collapsible. If this + field isn't set, the default button is used. """ header: str = proto.Field( @@ -393,6 +411,11 @@ class Section(proto.Message): proto.INT32, number=6, ) + collapse_control: "CollapseControl" = proto.Field( + proto.MESSAGE, + number=8, + message="CollapseControl", + ) class CardAction(proto.Message): r"""A card action is the action associated with the card. For example, @@ -400,7 +423,7 @@ class CardAction(proto.Message): invoice, or open the invoice in a browser. `Google Workspace - Add-ons `__: + add-ons `__: Attributes: action_label (str): @@ -420,6 +443,52 @@ class CardAction(proto.Message): message="OnClick", ) + class NestedWidget(proto.Message): + r"""A list of widgets that can be displayed in a containing layout, such + as a ``CarouselCard``. `Google Chat + apps `__: + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + text_paragraph (google.apps.card_v1.types.TextParagraph): + A text paragraph widget. + + This field is a member of `oneof`_ ``data``. + button_list (google.apps.card_v1.types.ButtonList): + A button list widget. + + This field is a member of `oneof`_ ``data``. + image (google.apps.card_v1.types.Image): + An image widget. + + This field is a member of `oneof`_ ``data``. + """ + + text_paragraph: "TextParagraph" = proto.Field( + proto.MESSAGE, + number=1, + oneof="data", + message="TextParagraph", + ) + button_list: "ButtonList" = proto.Field( + proto.MESSAGE, + number=3, + oneof="data", + message="ButtonList", + ) + image: "Image" = proto.Field( + proto.MESSAGE, + number=10, + oneof="data", + message="Image", + ) + class CardFixedFooter(proto.Message): r"""A persistent (sticky) footer that that appears at the bottom of the card. @@ -434,7 +503,7 @@ class CardFixedFooter(proto.Message): For an example in Google Chat apps, see `Add a persistent footer `__. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -521,7 +590,7 @@ class Widget(proto.Message): `Formatting text in Google Chat apps `__ and `Formatting text in Google Workspace - Add-ons `__. + add-ons `__. For example, the following JSON creates a bolded text: @@ -587,7 +656,6 @@ class Widget(proto.Message): "red": 0, "green": 0, "blue": 1, - "alpha": 1 }, "disabled": true, }, @@ -698,7 +766,7 @@ class Widget(proto.Message): "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", - "valueMsEpoch": "796435200000" + "valueMsEpoch": 796435200000 } This field is a member of `oneof`_ ``data``. @@ -722,7 +790,7 @@ class Widget(proto.Message): and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: For example, the following JSON creates a 2 column grid with @@ -800,6 +868,59 @@ class Widget(proto.Message): ] } + This field is a member of `oneof`_ ``data``. + carousel (google.apps.card_v1.types.Carousel): + A carousel contains a collection of nested widgets. For + example, this is a JSON representation of a carousel that + contains two text paragraphs. + + :: + + { + "widgets": [ + { + "textParagraph": { + "text": "First text paragraph in the carousel." + } + }, + { + "textParagraph": { + "text": "Second text paragraph in the carousel." + } + } + ] + } + + This field is a member of `oneof`_ ``data``. + chip_list (google.apps.card_v1.types.ChipList): + A list of chips. + + For example, the following JSON creates two chips. The first + is a text chip and the second is an icon chip that opens a + link: + + :: + + "chipList": { + "chips": [ + { + "text": "Edit", + "disabled": true, + }, + { + "icon": { + "knownIcon": "INVITE", + "altText": "check calendar" + }, + "onClick": { + "openLink": { + "url": "https://example.com/calendar" + } + } + } + ] + } + This field is a member of `oneof`_ ``data``. horizontal_alignment (google.apps.card_v1.types.Widget.HorizontalAlignment): Specifies whether widgets align to the left, @@ -809,7 +930,7 @@ class Widget(proto.Message): class ImageType(proto.Enum): r"""The shape used to crop the image. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Values: @@ -851,6 +972,24 @@ class HorizontalAlignment(proto.Enum): CENTER = 2 END = 3 + class VerticalAlignment(proto.Enum): + r"""Represents vertical alignment attribute. + + Values: + VERTICAL_ALIGNMENT_UNSPECIFIED (0): + Unspecified type. Do not use. + TOP (1): + Alignment to the top position. + MIDDLE (2): + Alignment to the middle position. + BOTTOM (3): + Alignment to the bottom position. + """ + VERTICAL_ALIGNMENT_UNSPECIFIED = 0 + TOP = 1 + MIDDLE = 2 + BOTTOM = 3 + text_paragraph: "TextParagraph" = proto.Field( proto.MESSAGE, number=1, @@ -911,6 +1050,18 @@ class HorizontalAlignment(proto.Enum): oneof="data", message="Columns", ) + carousel: "Carousel" = proto.Field( + proto.MESSAGE, + number=13, + oneof="data", + message="Carousel", + ) + chip_list: "ChipList" = proto.Field( + proto.MESSAGE, + number=14, + oneof="data", + message="ChipList", + ) horizontal_alignment: HorizontalAlignment = proto.Field( proto.ENUM, number=8, @@ -926,20 +1077,63 @@ class TextParagraph(proto.Message): Google Chat apps `__ and `Formatting text in Google Workspace - Add-ons `__. + add-ons `__. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: text (str): The text that's shown in the widget. + max_lines (int): + The maximum number of lines of text that are displayed in + the widget. If the text exceeds the specified maximum number + of lines, the excess content is concealed behind a **show + more** button. If the text is equal or shorter than the + specified maximum number of lines, a **show more** button + isn't displayed. + + The default value is 0, in which case all context is + displayed. Negative values are ignored. + text_syntax (google.apps.card_v1.types.TextParagraph.TextSyntax): + The syntax of the text. If not set, the text is rendered as + HTML. + + `Google Chat + apps `__: """ + class TextSyntax(proto.Enum): + r"""Syntax to use for formatting text. + + `Google Chat apps `__: + + Values: + TEXT_SYNTAX_UNSPECIFIED (0): + The text is rendered as HTML if unspecified. + HTML (1): + The text is rendered as HTML. This is the + default value. + MARKDOWN (2): + The text is rendered as Markdown. + """ + TEXT_SYNTAX_UNSPECIFIED = 0 + HTML = 1 + MARKDOWN = 2 + text: str = proto.Field( proto.STRING, number=1, ) + max_lines: int = proto.Field( + proto.INT32, + number=2, + ) + text_syntax: TextSyntax = proto.Field( + proto.ENUM, + number=4, + enum=TextSyntax, + ) class Image(proto.Message): @@ -947,7 +1141,7 @@ class Image(proto.Message): action. For an example, see `Add an image `__. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -987,7 +1181,7 @@ class Divider(proto.Message): example in Google Chat apps, see `Add a horizontal divider between widgets `__. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: For example, the following JSON creates a divider: @@ -1006,7 +1200,7 @@ class DecoratedText(proto.Message): Google Chat apps, see `Display text with decorative text `__. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: This message has `oneof`_ fields (mutually exclusive fields). @@ -1021,8 +1215,21 @@ class DecoratedText(proto.Message): Deprecated in favor of ``startIcon``. start_icon (google.apps.card_v1.types.Icon): The icon displayed in front of the text. + start_icon_vertical_alignment (google.apps.card_v1.types.Widget.VerticalAlignment): + Optional. Vertical alignment of the start icon. If not set, + the icon will be vertically centered. + + `Google Chat + apps `__: top_label (str): The text that appears above ``text``. Always truncates. + top_label_text (google.apps.card_v1.types.TextParagraph): + ``TextParagraph`` equivalent of ``top_label``. Always + truncates. Allows for more complex formatting than + ``top_label``. + + `Google Chat + apps `__: text (str): Required. The primary text. @@ -1030,7 +1237,13 @@ class DecoratedText(proto.Message): formatting text, see `Formatting text in Google Chat apps `__ and `Formatting text in Google Workspace - Add-ons `__. + add-ons `__. + content_text (google.apps.card_v1.types.TextParagraph): + ``TextParagraph`` equivalent of ``text``. Allows for more + complex formatting than ``text``. + + `Google Chat + apps `__: wrap_text (bool): The wrap text setting. If ``true``, the text wraps and displays on multiple lines. Otherwise, the text is @@ -1040,6 +1253,13 @@ class DecoratedText(proto.Message): ``bottomLabel``. bottom_label (str): The text that appears below ``text``. Always wraps. + bottom_label_text (google.apps.card_v1.types.TextParagraph): + ``TextParagraph`` equivalent of ``bottom_label``. Always + wraps. Allows for more complex formatting than + ``bottom_label``. + + `Google Chat + apps `__: on_click (google.apps.card_v1.types.OnClick): This action is triggered when users click ``topLabel`` or ``bottomLabel``. @@ -1069,7 +1289,7 @@ class SwitchControl(proto.Message): r"""Either a toggle-style switch or a checkbox inside a ``decoratedText`` widget. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Only supported in the ``decoratedText`` widget. @@ -1097,14 +1317,14 @@ class SwitchControl(proto.Message): control_type (google.apps.card_v1.types.DecoratedText.SwitchControl.ControlType): How the switch appears in the user interface. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: """ class ControlType(proto.Enum): r"""How the switch appears in the user interface. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Values: @@ -1152,14 +1372,29 @@ class ControlType(proto.Enum): number=12, message="Icon", ) + start_icon_vertical_alignment: "Widget.VerticalAlignment" = proto.Field( + proto.ENUM, + number=13, + enum="Widget.VerticalAlignment", + ) top_label: str = proto.Field( proto.STRING, number=3, ) + top_label_text: "TextParagraph" = proto.Field( + proto.MESSAGE, + number=17, + message="TextParagraph", + ) text: str = proto.Field( proto.STRING, number=4, ) + content_text: "TextParagraph" = proto.Field( + proto.MESSAGE, + number=18, + message="TextParagraph", + ) wrap_text: bool = proto.Field( proto.BOOL, number=5, @@ -1168,6 +1403,11 @@ class ControlType(proto.Enum): proto.STRING, number=6, ) + bottom_label_text: "TextParagraph" = proto.Field( + proto.MESSAGE, + number=19, + message="TextParagraph", + ) on_click: "OnClick" = proto.Field( proto.MESSAGE, number=7, @@ -1195,8 +1435,11 @@ class ControlType(proto.Enum): class TextInput(proto.Message): r"""A field in which users can enter text. Supports suggestions and - on-change actions. For an example in Google Chat apps, see `Add a - field in which a user can enter + on-change actions. Supports form submission validation. When + ``Action.all_widgets_are_required`` is set to ``true`` or this + widget is specified in ``Action.required_widgets``, the submission + action is blocked unless a value is entered. For an example in + Google Chat apps, see `Add a field in which a user can enter text `__. Chat apps receive and can process the value of entered text during @@ -1208,7 +1451,7 @@ class TextInput(proto.Message): a text input. To collect defined or enumerated data from users, use the [SelectionInput][google.apps.card.v1.SelectionInput] widget. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -1275,7 +1518,7 @@ class TextInput(proto.Message): When specified, ``TextInput.type`` is always ``SINGLE_LINE``, even if it's set to ``MULTIPLE_LINE``. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: auto_complete_action (google.apps.card_v1.types.Action): Optional. Specify what action to take when the text input @@ -1288,7 +1531,13 @@ class TextInput(proto.Message): as running a custom function. `Google Workspace - Add-ons `__: + add-ons `__: + validation (google.apps.card_v1.types.Validation): + Specify the input format validation necessary for this text + field. + + `Google Workspace add-ons and Chat + apps `__: placeholder_text (str): Text that appears in the text input field when the field is empty. Use this text to prompt users to enter a value. For @@ -1304,7 +1553,7 @@ class Type(proto.Enum): ``initialSuggestions`` is specified, ``type`` is always ``SINGLE_LINE``, even if it's set to ``MULTIPLE_LINE``. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Values: @@ -1354,6 +1603,11 @@ class Type(proto.Enum): number=8, message="Action", ) + validation: "Validation" = proto.Field( + proto.MESSAGE, + number=11, + message="Validation", + ) placeholder_text: str = proto.Field( proto.STRING, number=12, @@ -1379,7 +1633,7 @@ class Suggestions(proto.Message): When specified, ``TextInput.type`` is always ``SINGLE_LINE``, even if it's set to ``MULTIPLE_LINE``. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -1391,7 +1645,7 @@ class Suggestions(proto.Message): class SuggestionItem(proto.Message): r"""One suggested value that users can enter in a text input field. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: @@ -1424,7 +1678,7 @@ class ButtonList(proto.Message): Chat apps, see `Add a button `__. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -1441,9 +1695,14 @@ class ButtonList(proto.Message): class SelectionInput(proto.Message): r"""A widget that creates one or more UI items that users can select. - For example, a dropdown menu or checkboxes. You can use this widget - to collect data that can be predicted or enumerated. For an example - in Google Chat apps, see `Add selectable UI + Supports form submission validation for ``dropdown`` and + ``multiselect`` menus only. When ``Action.all_widgets_are_required`` + is set to ``true`` or this widget is specified in + ``Action.required_widgets``, the submission action is blocked unless + a value is selected. For example, a dropdown menu or checkboxes. You + can use this widget to collect data that can be predicted or + enumerated. For an example in Google Chat apps, see `Add selectable + UI elements `__. Chat apps can process the value of items that users select or input. @@ -1453,7 +1712,7 @@ class SelectionInput(proto.Message): To collect undefined or abstract data from users, use the [TextInput][google.apps.card.v1.TextInput] widget. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: This message has `oneof`_ fields (mutually exclusive fields). @@ -1465,8 +1724,8 @@ class SelectionInput(proto.Message): Attributes: name (str): - The name that identifies the selection input in a form input - event. + Required. The name that identifies the selection input in a + form input event. For details about working with form inputs, see `Receive form @@ -1502,18 +1761,25 @@ class SelectionInput(proto.Message): For multiselect menus, the maximum number of items that a user can select. Minimum value is 1 item. If unspecified, defaults to 3 items. + + This field is a member of `oneof`_ ``_multi_select_max_selected_items``. multi_select_min_query_length (int): - For multiselect menus, the number of text - characters that a user inputs before the app - queries autocomplete and displays suggested - items in the menu. - - If unspecified, defaults to 0 characters for - static data sources and 3 characters for - external data sources. + For multiselect menus, the number of text characters that a + user inputs before the menu returns suggested selection + items. + + If unset, the multiselect menu uses the following default + values: + + - If the menu uses a static array of ``SelectionInput`` + items, defaults to 0 characters and immediately populates + items from the array. + - If the menu uses a dynamic data source + (``multi_select_data_source``), defaults to 3 characters + before querying the data source to return suggested items. external_data_source (google.apps.card_v1.types.Action): An external data source, such as a relational - data base. + database. This field is a member of `oneof`_ ``multi_select_data_source``. platform_data_source (google.apps.card_v1.types.SelectionInput.PlatformDataSource): @@ -1531,7 +1797,7 @@ class SelectionType(proto.Enum): Each selection input supports one type of selection. Mixing checkboxes and switches, for example, isn't supported. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Values: @@ -1548,31 +1814,29 @@ class SelectionType(proto.Enum): A dropdown menu. Users can select one item from the menu. MULTI_SELECT (4): - A multiselect menu for static or dynamic data. From the menu - bar, users select one or more items. Users can also input - values to populate dynamic data. For example, users can - start typing the name of a Google Chat space and the widget - autosuggests the space. + A menu with a text box. Users can type and select one or + more items. For Google Workspace add-ons, you must populate + items using a static array of ``SelectionItem`` objects. - To populate items for a multiselect menu, you can use one of - the following types of data sources: + For Google Chat apps, you can also populate items using a + dynamic data source and autosuggest items as users type in + the menu. For example, users can start typing the name of a + Google Chat space and the widget autosuggests the space. To + dynamically populate items for a multiselect menu, use one + of the following types of data sources: - - Static data: Items are specified as ``SelectionItem`` - objects in the widget. Up to 100 items. - Google Workspace data: Items are populated using data from Google Workspace, such as Google Workspace users or Google Chat spaces. - External data: Items are populated from an external data source outside of Google Workspace. - For examples of how to implement multiselect menus, see `Add - a multiselect + For examples of how to implement multiselect menus for Chat + apps, see `Add a multiselect menu `__. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: - Multiselect for Google Workspace Add-ons are in Developer - Preview. """ CHECK_BOX = 0 RADIO_BUTTON = 1 @@ -1582,11 +1846,14 @@ class SelectionType(proto.Enum): class SelectionItem(proto.Message): r"""An item that users can select in a selection input, such as a - checkbox or switch. + checkbox or switch. Supports up to 100 items. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: text (str): The text that identifies or describes the @@ -1604,10 +1871,8 @@ class SelectionItem(proto.Message): as for radio buttons or a dropdown menu), only set this field for one item. start_icon_uri (str): - For multiselect menus, the URL for the icon displayed next - to the item's ``text`` field. Supports PNG and JPEG files. - Must be an ``HTTPS`` URL. For example, - ``https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png``. + + This field is a member of `oneof`_ ``start_icon``. bottom_text (str): For multiselect menus, a text description or label that's displayed below the item's ``text`` field. @@ -1628,6 +1893,7 @@ class SelectionItem(proto.Message): start_icon_uri: str = proto.Field( proto.STRING, number=4, + oneof="start_icon", ) bottom_text: str = proto.Field( proto.STRING, @@ -1705,6 +1971,7 @@ class CommonDataSource(proto.Enum): multi_select_max_selected_items: int = proto.Field( proto.INT32, number=6, + optional=True, ) multi_select_min_query_length: int = proto.Field( proto.INT32, @@ -1725,17 +1992,24 @@ class CommonDataSource(proto.Enum): class DateTimePicker(proto.Message): - r"""Lets users input a date, a time, or both a date and a time. For an - example in Google Chat apps, see `Let a user pick a date and + r"""Lets users input a date, a time, or both a date and a time. Supports + form submission validation. When ``Action.all_widgets_are_required`` + is set to ``true`` or this widget is specified in + ``Action.required_widgets``, the submission action is blocked unless + a value is selected. For an example in Google Chat apps, see `Let a + user pick a date and time `__. Users can input text or use the picker to select dates and times. If users input an invalid date or time, the picker shows an error that prompts users to input the information correctly. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: name (str): The name by which the ``DateTimePicker`` is identified in a @@ -1753,8 +2027,8 @@ class DateTimePicker(proto.Message): Whether the widget supports inputting a date, a time, or the date and time. value_ms_epoch (int): - The default value displayed in the widget, in milliseconds - since `Unix epoch + Optional. The default value displayed in the widget, in + milliseconds since `Unix epoch time `__. Specify the value based on the type of picker @@ -1768,6 +2042,8 @@ class DateTimePicker(proto.Message): ``1672531200000``. - ``TIME_ONLY``: a time in UTC. For example, to represent 12:00 PM, use ``43200000`` (or ``12 * 60 * 60 * 1000``). + + This field is a member of `oneof`_ ``_value_ms_epoch``. timezone_offset_date (int): The number representing the time zone offset from UTC, in minutes. If set, the ``value_ms_epoch`` is displayed in the @@ -1783,7 +2059,7 @@ class DateTimePickerType(proto.Enum): Determines whether users can input a date, a time, or both a date and time. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Values: @@ -1814,6 +2090,7 @@ class DateTimePickerType(proto.Enum): value_ms_epoch: int = proto.Field( proto.INT64, number=4, + optional=True, ) timezone_offset_date: int = proto.Field( proto.INT32, @@ -1826,6 +2103,69 @@ class DateTimePickerType(proto.Enum): ) +class OverflowMenu(proto.Message): + r"""A widget that presents a pop-up menu with one or more actions that + users can invoke. For example, showing non-primary actions in a + card. You can use this widget when actions don't fit in the + available space. To use, specify this widget in the ``OnClick`` + action of widgets that support it. For example, in a ``Button``. + + `Google Workspace add-ons and Chat + apps `__: + + Attributes: + items (MutableSequence[google.apps.card_v1.types.OverflowMenu.OverflowMenuItem]): + Required. The list of menu options. + """ + + class OverflowMenuItem(proto.Message): + r"""An option that users can invoke in an overflow menu. + + `Google Workspace add-ons and Chat + apps `__: + + Attributes: + start_icon (google.apps.card_v1.types.Icon): + The icon displayed in front of the text. + text (str): + Required. The text that identifies or + describes the item to users. + on_click (google.apps.card_v1.types.OnClick): + Required. The action invoked when a menu option is selected. + This ``OnClick`` cannot contain an ``OverflowMenu``, any + specified ``OverflowMenu`` is dropped and the menu item + disabled. + disabled (bool): + Whether the menu option is disabled. + Defaults to false. + """ + + start_icon: "Icon" = proto.Field( + proto.MESSAGE, + number=1, + message="Icon", + ) + text: str = proto.Field( + proto.STRING, + number=2, + ) + on_click: "OnClick" = proto.Field( + proto.MESSAGE, + number=3, + message="OnClick", + ) + disabled: bool = proto.Field( + proto.BOOL, + number=4, + ) + + items: MutableSequence[OverflowMenuItem] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=OverflowMenuItem, + ) + + class Button(proto.Message): r"""A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see `Add a @@ -1836,44 +2176,30 @@ class Button(proto.Message): [``ImageComponent``][google.apps.card.v1.ImageComponent]) and set an ``onClick`` action. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: text (str): The text displayed inside the button. icon (google.apps.card_v1.types.Icon): - The icon image. If both ``icon`` and ``text`` are set, then - the icon appears before the text. + An icon displayed inside the button. If both ``icon`` and + ``text`` are set, then the icon appears before the text. color (google.type.color_pb2.Color): - If set, the button is filled with a solid background color - and the font color changes to maintain contrast with the - background color. For example, setting a blue background - likely results in white text. - - If unset, the image background is white and the font color - is blue. + Optional. The color of the button. If set, the button + ``type`` is set to ``FILLED`` and the color of ``text`` and + ``icon`` fields are set to a contrasting color for + readability. For example, if the button color is set to + blue, any text or icons in the button are set to white. - For red, green, and blue, the value of each field is a - ``float`` number that you can express in either of two ways: - as a number between 0 and 255 divided by 255 (153/255), or - as a value between 0 and 1 (0.6). 0 represents the absence - of a color and 1 or 255/255 represent the full presence of - that color on the RGB scale. + To set the button color, specify a value for the ``red``, + ``green``, and ``blue`` fields. The value must be a float + number between 0 and 1 based on the RGB color value, where + ``0`` (0/255) represents the absence of color and ``1`` + (255/255) represents the maximum intensity of the color. - Optionally set ``alpha``, which sets a level of transparency - using this equation: - - :: - - pixel color = alpha * (this color) + (1.0 - alpha) * (background color) - - For ``alpha``, a value of ``1`` corresponds with a solid - color, and a value of ``0`` corresponds with a completely - transparent color. - - For example, the following color represents a half - transparent red: + For example, the following sets the color to red at its + maximum intensity: :: @@ -1881,8 +2207,10 @@ class Button(proto.Message): "red": 1, "green": 0, "blue": 0, - "alpha": 0.5 } + + The ``alpha`` field is unavailable for button color. If + specified, this field is ignored. on_click (google.apps.card_v1.types.OnClick): Required. The action to perform when a user clicks the button, such as opening a hyperlink @@ -1899,8 +2227,52 @@ class Button(proto.Message): browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat". + type_ (google.apps.card_v1.types.Button.Type): + Optional. The type of a button. If unset, button type + defaults to ``OUTLINED``. If the ``color`` field is set, the + button type is forced to ``FILLED`` and any value set for + this field is ignored. """ + class Type(proto.Enum): + r"""Optional. The + `type `__ + of a button. If ``color`` field is set, the ``type`` is forced to + ``FILLED``. + + `Google Chat apps `__: + + Values: + TYPE_UNSPECIFIED (0): + Don't use. Unspecified. + OUTLINED (1): + Outlined buttons are medium-emphasis buttons. + They usually contain actions that are important, + but aren’t the primary action in a Chat app or + an add-on. + FILLED (2): + A filled button has a container with a solid + color. It has the most visual impact and is + recommended for the important and primary action + in a Chat app or an add-on. + FILLED_TONAL (3): + A filled tonal button is an alternative + middle ground between filled and outlined + buttons. They’re useful in contexts where a + lower-priority button requires slightly more + emphasis than an outline button would give. + BORDERLESS (4): + A button does not have an invisible container + in its default state. It is often used for the + lowest priority actions, especially when + presenting multiple options. + """ + TYPE_UNSPECIFIED = 0 + OUTLINED = 1 + FILLED = 2 + FILLED_TONAL = 3 + BORDERLESS = 4 + text: str = proto.Field( proto.STRING, number=1, @@ -1928,6 +2300,11 @@ class Button(proto.Message): proto.STRING, number=6, ) + type_: Type = proto.Field( + proto.ENUM, + number=7, + enum=Type, + ) class Icon(proto.Message): @@ -1941,7 +2318,7 @@ class Icon(proto.Message): `custom `__ icons. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: This message has `oneof`_ fields (mutually exclusive fields). @@ -2112,7 +2489,7 @@ class MaterialIcon(proto.Message): class ImageCropStyle(proto.Message): r"""Represents the crop style applied to an image. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: For example, here's how to apply a 16:9 aspect ratio: @@ -2144,7 +2521,7 @@ class ImageCropStyle(proto.Message): class ImageCropType(proto.Enum): r"""Represents the crop style applied to an image. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Values: @@ -2182,7 +2559,7 @@ class BorderStyle(proto.Message): r"""The style options for the border of a card or widget, including the border type and color. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -2190,6 +2567,26 @@ class BorderStyle(proto.Message): The border type. stroke_color (google.type.color_pb2.Color): The colors to use when the type is ``BORDER_TYPE_STROKE``. + + To set the stroke color, specify a value for the ``red``, + ``green``, and ``blue`` fields. The value must be a float + number between 0 and 1 based on the RGB color value, where + ``0`` (0/255) represents the absence of color and ``1`` + (255/255) represents the maximum intensity of the color. + + For example, the following sets the color to red at its + maximum intensity: + + :: + + "color": { + "red": 1, + "green": 0, + "blue": 0, + } + + The ``alpha`` field is unavailable for stroke color. If + specified, this field is ignored. corner_radius (int): The corner radius for the border. """ @@ -2197,16 +2594,16 @@ class BorderStyle(proto.Message): class BorderType(proto.Enum): r"""Represents the border types applied to widgets. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Values: BORDER_TYPE_UNSPECIFIED (0): Don't use. Unspecified. NO_BORDER (1): - Default value. No border. + No border. STROKE (2): - Outline. + Default value. Outline. """ BORDER_TYPE_UNSPECIFIED = 0 NO_BORDER = 1 @@ -2231,7 +2628,7 @@ class BorderType(proto.Enum): class ImageComponent(proto.Message): r"""Represents an image. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -2277,7 +2674,7 @@ class Grid(proto.Message): is determined by items divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: For example, the following JSON creates a 2 column grid with a @@ -2338,7 +2735,7 @@ class GridItem(proto.Message): r"""Represents an item in a grid layout. Items can contain text, an image, or both text and an image. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -2359,7 +2756,7 @@ class GridItem(proto.Message): class GridItemLayout(proto.Enum): r"""Represents the various layout options available for a grid item. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Values: @@ -2448,12 +2845,17 @@ class Columns(proto.Message): - On Android devices, the second column wraps if the screen width is less than or equal to 320 dp. - To include more than 2 columns, or to use rows, use the + To include more than two columns, or to use rows, use the [``Grid``][google.apps.card.v1.Grid] widget. - `Google Workspace Add-ons and Chat - apps `__: Columns - for Google Workspace Add-ons are in Developer Preview. + `Google Workspace add-ons and Chat + apps `__: The add-on + UIs that support columns include: + + - The dialog displayed when users open the add-on from an email + draft. + - The dialog displayed when users open the add-on from the **Add + attachment** menu in a Google Calendar event. Attributes: column_items (MutableSequence[google.apps.card_v1.types.Columns.Column]): @@ -2464,9 +2866,8 @@ class Columns(proto.Message): class Column(proto.Message): r"""A column. - `Google Workspace Add-ons and Chat - apps `__: Columns - for Google Workspace Add-ons are in Developer Preview. + `Google Workspace add-ons and Chat + apps `__ Attributes: horizontal_size_style (google.apps.card_v1.types.Columns.Column.HorizontalSizeStyle): @@ -2489,9 +2890,8 @@ class HorizontalSizeStyle(proto.Enum): each column depends on both the ``HorizontalSizeStyle`` and the width of the widgets within the column. - `Google Workspace Add-ons and Chat - apps `__: Columns - for Google Workspace Add-ons are in Developer Preview. + `Google Workspace add-ons and Chat + apps `__ Values: HORIZONTAL_SIZE_STYLE_UNSPECIFIED (0): @@ -2514,9 +2914,8 @@ class VerticalAlignment(proto.Enum): r"""Specifies whether widgets align to the top, bottom, or center of a column. - `Google Workspace Add-ons and Chat - apps `__: Columns - for Google Workspace Add-ons are in Developer Preview. + `Google Workspace add-ons and Chat + apps `__ Values: VERTICAL_ALIGNMENT_UNSPECIFIED (0): @@ -2537,9 +2936,8 @@ class VerticalAlignment(proto.Enum): class Widgets(proto.Message): r"""The supported widgets that you can include in a column. - `Google Workspace Add-ons and Chat - apps `__: Columns - for Google Workspace Add-ons are in Developer Preview. + `Google Workspace add-ons and Chat + apps `__ This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -2576,6 +2974,10 @@ class Widgets(proto.Message): date_time_picker (google.apps.card_v1.types.DateTimePicker): [DateTimePicker][google.apps.card.v1.DateTimePicker] widget. + This field is a member of `oneof`_ ``data``. + chip_list (google.apps.card_v1.types.ChipList): + [ChipList][google.apps.card.v1.ChipList] widget. + This field is a member of `oneof`_ ``data``. """ @@ -2621,6 +3023,12 @@ class Widgets(proto.Message): oneof="data", message="DateTimePicker", ) + chip_list: "ChipList" = proto.Field( + proto.MESSAGE, + number=8, + oneof="data", + message="ChipList", + ) horizontal_size_style: "Columns.Column.HorizontalSizeStyle" = proto.Field( proto.ENUM, @@ -2650,11 +3058,132 @@ class Widgets(proto.Message): ) +class Carousel(proto.Message): + r"""A carousel, also known as a slider, rotates and displays a list of + widgets in a slideshow format, with buttons navigating to the + previous or next widget. + + For example, this is a JSON representation of a carousel that + contains three text paragraph widgets. + + :: + + { + "carouselCards": [ + { + "widgets": [ + { + "textParagraph": { + "text": "First text paragraph in carousel", + } + } + ] + }, + { + "widgets": [ + { + "textParagraph": { + "text": "Second text paragraph in carousel", + } + } + ] + }, + { + "widgets": [ + { + "textParagraph": { + "text": "Third text paragraph in carousel", + } + } + ] + } + ] + } + + `Google Chat apps `__: + + Attributes: + carousel_cards (MutableSequence[google.apps.card_v1.types.Carousel.CarouselCard]): + A list of cards included in the carousel. + """ + + class CarouselCard(proto.Message): + r"""A card that can be displayed as a carousel item. `Google Chat + apps `__: + + Attributes: + widgets (MutableSequence[google.apps.card_v1.types.Card.NestedWidget]): + A list of widgets displayed in the carousel + card. The widgets are displayed in the order + that they are specified. + footer_widgets (MutableSequence[google.apps.card_v1.types.Card.NestedWidget]): + A list of widgets displayed at the bottom of + the carousel card. The widgets are displayed in + the order that they are specified. + """ + + widgets: MutableSequence["Card.NestedWidget"] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Card.NestedWidget", + ) + footer_widgets: MutableSequence["Card.NestedWidget"] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="Card.NestedWidget", + ) + + carousel_cards: MutableSequence[CarouselCard] = proto.RepeatedField( + proto.MESSAGE, + number=4, + message=CarouselCard, + ) + + +class CollapseControl(proto.Message): + r"""Represent an expand and collapse control. + + `Google Workspace add-ons and Chat + apps `__: + + Attributes: + horizontal_alignment (google.apps.card_v1.types.Widget.HorizontalAlignment): + The horizontal alignment of the expand and + collapse button. + expand_button (google.apps.card_v1.types.Button): + Optional. Define a customizable button to expand the + section. Both expand_button and collapse_button field must + be set. Only one field set will not take into effect. If + this field isn't set, the default button is used. + collapse_button (google.apps.card_v1.types.Button): + Optional. Define a customizable button to collapse the + section. Both expand_button and collapse_button field must + be set. Only one field set will not take into effect. If + this field isn't set, the default button is used. + """ + + horizontal_alignment: "Widget.HorizontalAlignment" = proto.Field( + proto.ENUM, + number=1, + enum="Widget.HorizontalAlignment", + ) + expand_button: "Button" = proto.Field( + proto.MESSAGE, + number=2, + message="Button", + ) + collapse_button: "Button" = proto.Field( + proto.MESSAGE, + number=3, + message="Button", + ) + + class OnClick(proto.Message): r"""Represents how to respond when users click an interactive element on a card, such as a button. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: This message has `oneof`_ fields (mutually exclusive fields). @@ -2681,7 +3210,7 @@ class OnClick(proto.Message): open link action response comes back. `Google Workspace - Add-ons `__: + add-ons `__: This field is a member of `oneof`_ ``data``. card (google.apps.card_v1.types.Card): @@ -2689,7 +3218,11 @@ class OnClick(proto.Message): specified. `Google Workspace - Add-ons `__: + add-ons `__: + + This field is a member of `oneof`_ ``data``. + overflow_menu (google.apps.card_v1.types.OverflowMenu): + If specified, this ``onClick`` opens an overflow menu. This field is a member of `oneof`_ ``data``. """ @@ -2718,12 +3251,18 @@ class OnClick(proto.Message): oneof="data", message="Card", ) + overflow_menu: "OverflowMenu" = proto.Field( + proto.MESSAGE, + number=8, + oneof="data", + message="OverflowMenu", + ) class OpenLink(proto.Message): r"""Represents an ``onClick`` event that opens a hyperlink. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -2733,13 +3272,13 @@ class OpenLink(proto.Message): How to open a link. `Google Workspace - Add-ons `__: + add-ons `__: on_close (google.apps.card_v1.types.OpenLink.OnClose): Whether the client forgets about a link after opening it, or observes it until the window closes. `Google Workspace - Add-ons `__: + add-ons `__: """ class OpenAs(proto.Enum): @@ -2751,7 +3290,7 @@ class OpenAs(proto.Enum): supported by all clients. `Google Workspace - Add-ons `__: + add-ons `__: Values: FULL_SIZE (0): @@ -2776,7 +3315,7 @@ class OnClose(proto.Enum): platform can't support both values, ``OnClose`` takes precedence. `Google Workspace - Add-ons `__: + add-ons `__: Values: NOTHING (0): @@ -2815,13 +3354,13 @@ class Action(proto.Message): form. If the action is triggered, the form values are sent to the server. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: function (str): A custom function to invoke when the containing element is - clicked or othrwise activated. + clicked or otherwise activated. For example usage, see `Read form data `__. @@ -2873,13 +3412,28 @@ class Action(proto.Message): `Google Chat apps `__: + required_widgets (MutableSequence[str]): + Optional. Fill this list with the names of widgets that this + Action needs for a valid submission. + + If the widgets listed here don't have a value when this + Action is invoked, the form submission is aborted. + + `Google Workspace add-ons and Chat + apps `__: + all_widgets_are_required (bool): + Optional. If this is true, then all widgets are considered + required by this action. + + `Google Workspace add-ons and Chat + apps `__: """ class LoadIndicator(proto.Enum): r"""Specifies the loading indicator that the action displays while making the call to the action. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Values: @@ -2942,7 +3496,7 @@ class ActionParameter(proto.Message): To learn more, see ```CommonEventObject`` `__. - `Google Workspace Add-ons and Chat + `Google Workspace add-ons and Chat apps `__: Attributes: @@ -2985,6 +3539,178 @@ class ActionParameter(proto.Message): number=5, enum=Interaction, ) + required_widgets: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=6, + ) + all_widgets_are_required: bool = proto.Field( + proto.BOOL, + number=7, + ) + + +class Validation(proto.Message): + r"""Represents the necessary data for validating the widget it's + attached to. + + `Google Workspace add-ons and Chat + apps `__: + + Attributes: + character_limit (int): + Specify the character limit for text input widgets. Note + that this is only used for text input and is ignored for + other widgets. + + `Google Workspace add-ons and Chat + apps `__: + input_type (google.apps.card_v1.types.Validation.InputType): + Specify the type of the input widgets. + + `Google Workspace add-ons and Chat + apps `__: + """ + + class InputType(proto.Enum): + r"""The type of the input widget. + + Values: + INPUT_TYPE_UNSPECIFIED (0): + Unspecified type. Do not use. + TEXT (1): + Regular text that accepts all characters. + INTEGER (2): + An integer value. + FLOAT (3): + A float value. + EMAIL (4): + An email address. + EMOJI_PICKER (5): + A emoji selected from system-provided emoji + picker. + """ + INPUT_TYPE_UNSPECIFIED = 0 + TEXT = 1 + INTEGER = 2 + FLOAT = 3 + EMAIL = 4 + EMOJI_PICKER = 5 + + character_limit: int = proto.Field( + proto.INT32, + number=1, + ) + input_type: InputType = proto.Field( + proto.ENUM, + number=2, + enum=InputType, + ) + + +class ChipList(proto.Message): + r"""A list of chips layed out horizontally, which can either scroll + horizontally or wrap to the next line. + + `Google Workspace add-ons and Chat + apps `__: + + Attributes: + layout (google.apps.card_v1.types.ChipList.Layout): + Specified chip list layout. + chips (MutableSequence[google.apps.card_v1.types.Chip]): + An array of chips. + """ + + class Layout(proto.Enum): + r"""The chip list layout. + + Values: + LAYOUT_UNSPECIFIED (0): + Don't use. Unspecified. + WRAPPED (1): + Default value. The chip list wraps to the + next line if there isn't enough horizontal + space. + HORIZONTAL_SCROLLABLE (2): + The chips scroll horizontally if they don't + fit in the available space. + """ + LAYOUT_UNSPECIFIED = 0 + WRAPPED = 1 + HORIZONTAL_SCROLLABLE = 2 + + layout: Layout = proto.Field( + proto.ENUM, + number=1, + enum=Layout, + ) + chips: MutableSequence["Chip"] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="Chip", + ) + + +class Chip(proto.Message): + r"""A text, icon, or text and icon chip that users can click. + + `Google Workspace add-ons and Chat + apps `__: + + Attributes: + icon (google.apps.card_v1.types.Icon): + The icon image. If both ``icon`` and ``text`` are set, then + the icon appears before the text. + label (str): + The text displayed inside the chip. + on_click (google.apps.card_v1.types.OnClick): + Optional. The action to perform when a user + clicks the chip, such as opening a hyperlink or + running a custom function. + enabled (bool): + Whether the chip is in an active state and responds to user + actions. Defaults to ``true``. Deprecated. Use ``disabled`` + instead. + disabled (bool): + Whether the chip is in an inactive state and ignores user + actions. Defaults to ``false``. + alt_text (str): + The alternative text that's used for + accessibility. + Set descriptive text that lets users know what + the chip does. For example, if a chip opens a + hyperlink, write: "Opens a new browser tab and + navigates to the Google Chat developer + documentation at + https://developers.google.com/workspace/chat". + """ + + icon: "Icon" = proto.Field( + proto.MESSAGE, + number=1, + message="Icon", + ) + label: str = proto.Field( + proto.STRING, + number=2, + ) + on_click: "OnClick" = proto.Field( + proto.MESSAGE, + number=3, + message="OnClick", + ) + enabled: bool = proto.Field( + proto.BOOL, + number=4, + ) + disabled: bool = proto.Field( + proto.BOOL, + number=6, + ) + alt_text: str = proto.Field( + proto.STRING, + number=5, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization/__init__.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization/__init__.py index 207687d83f87..60112a2f9387 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization/__init__.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization/__init__.py @@ -37,8 +37,12 @@ InjectedSolutionConstraint, InputConfig, Location, + OptimizeToursLongRunningMetadata, OptimizeToursRequest, OptimizeToursResponse, + OptimizeToursUriMetadata, + OptimizeToursUriRequest, + OptimizeToursUriResponse, OptimizeToursValidationError, OutputConfig, RouteModifiers, @@ -50,7 +54,9 @@ SkippedShipment, TimeWindow, TransitionAttributes, + Uri, Vehicle, + VehicleFullness, Waypoint, ) @@ -68,8 +74,12 @@ "InjectedSolutionConstraint", "InputConfig", "Location", + "OptimizeToursLongRunningMetadata", "OptimizeToursRequest", "OptimizeToursResponse", + "OptimizeToursUriMetadata", + "OptimizeToursUriRequest", + "OptimizeToursUriResponse", "OptimizeToursValidationError", "OutputConfig", "RouteModifiers", @@ -81,7 +91,9 @@ "SkippedShipment", "TimeWindow", "TransitionAttributes", + "Uri", "Vehicle", + "VehicleFullness", "Waypoint", "DataFormat", ) diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/__init__.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/__init__.py index 48f36cec6dd6..50d22b5ea269 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/__init__.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/__init__.py @@ -35,8 +35,12 @@ InjectedSolutionConstraint, InputConfig, Location, + OptimizeToursLongRunningMetadata, OptimizeToursRequest, OptimizeToursResponse, + OptimizeToursUriMetadata, + OptimizeToursUriRequest, + OptimizeToursUriResponse, OptimizeToursValidationError, OutputConfig, RouteModifiers, @@ -48,7 +52,9 @@ SkippedShipment, TimeWindow, TransitionAttributes, + Uri, Vehicle, + VehicleFullness, Waypoint, ) @@ -66,8 +72,12 @@ "InjectedSolutionConstraint", "InputConfig", "Location", + "OptimizeToursLongRunningMetadata", "OptimizeToursRequest", "OptimizeToursResponse", + "OptimizeToursUriMetadata", + "OptimizeToursUriRequest", + "OptimizeToursUriResponse", "OptimizeToursValidationError", "OutputConfig", "RouteModifiers", @@ -80,6 +90,8 @@ "SkippedShipment", "TimeWindow", "TransitionAttributes", + "Uri", "Vehicle", + "VehicleFullness", "Waypoint", ) diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/gapic_metadata.json b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/gapic_metadata.json index 386551edc86c..257ec16c60cb 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/gapic_metadata.json +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/gapic_metadata.json @@ -19,6 +19,16 @@ "methods": [ "optimize_tours" ] + }, + "OptimizeToursLongRunning": { + "methods": [ + "optimize_tours_long_running" + ] + }, + "OptimizeToursUri": { + "methods": [ + "optimize_tours_uri" + ] } } }, @@ -34,6 +44,16 @@ "methods": [ "optimize_tours" ] + }, + "OptimizeToursLongRunning": { + "methods": [ + "optimize_tours_long_running" + ] + }, + "OptimizeToursUri": { + "methods": [ + "optimize_tours_uri" + ] } } }, @@ -49,6 +69,16 @@ "methods": [ "optimize_tours" ] + }, + "OptimizeToursLongRunning": { + "methods": [ + "optimize_tours_long_running" + ] + }, + "OptimizeToursUri": { + "methods": [ + "optimize_tours_uri" + ] } } } diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/async_client.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/async_client.py index 1cfdceca5b8e..4c9d3fe57073 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/async_client.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/async_client.py @@ -563,6 +563,260 @@ async def sample_batch_optimize_tours(): # Done; return the response. return response + async def optimize_tours_long_running( + self, + request: Optional[ + Union[route_optimization_service.OptimizeToursRequest, dict] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation_async.AsyncOperation: + r"""This is a variant of the + [OptimizeTours][google.maps.routeoptimization.v1.RouteOptimization.OptimizeTours] + method designed for optimizations with large timeout values. It + should be preferred over the ``OptimizeTours`` method for + optimizations that take longer than a few minutes. + + The returned [long-running + operation][google.longrunning.Operation] (LRO) will have a name + of the format ``/operations/`` and can be + used to track progress of the computation. The + [metadata][google.longrunning.Operation.metadata] field type is + [OptimizeToursLongRunningMetadata][google.maps.routeoptimization.v1.OptimizeToursLongRunningMetadata]. + The [response][google.longrunning.Operation.response] field type + is + [OptimizeToursResponse][google.maps.routeoptimization.v1.OptimizeToursResponse], + if successful. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request + for more details. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.maps import routeoptimization_v1 + + async def sample_optimize_tours_long_running(): + # Create a client + client = routeoptimization_v1.RouteOptimizationAsyncClient() + + # Initialize request argument(s) + request = routeoptimization_v1.OptimizeToursRequest( + parent="parent_value", + ) + + # Make the request + operation = client.optimize_tours_long_running(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.maps.routeoptimization_v1.types.OptimizeToursRequest, dict]]): + The request object. Request to be given to a tour + optimization solver which defines the + shipment model to solve as well as + optimization parameters. + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.maps.routeoptimization_v1.types.OptimizeToursResponse` Response after solving a tour optimization problem containing the routes + followed by each vehicle, the shipments which have + been skipped and the overall cost of the solution. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, route_optimization_service.OptimizeToursRequest): + request = route_optimization_service.OptimizeToursRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.optimize_tours_long_running + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + route_optimization_service.OptimizeToursResponse, + metadata_type=route_optimization_service.OptimizeToursLongRunningMetadata, + ) + + # Done; return the response. + return response + + async def optimize_tours_uri( + self, + request: Optional[ + Union[route_optimization_service.OptimizeToursUriRequest, dict] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation_async.AsyncOperation: + r"""This is a variant of the + [OptimizeToursLongRunning][google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursLongRunning] + method designed for optimizations with large timeout values and + large input/output sizes. + + The client specifies the URI of the ``OptimizeToursRequest`` + stored in Google Cloud Storage and the server writes the + ``OptimizeToursResponse`` to a client-specified Google Cloud + Storage URI. + + This method should be preferred over the ``OptimizeTours`` + method for optimizations that take longer than a few minutes and + input/output sizes that are larger than 8MB, though it can be + used for shorter and smaller optimizations as well. + + The returned [long-running + operation][google.longrunning.Operation] (LRO) will have a name + of the format ``/operations/`` and can be + used to track progress of the computation. The + [metadata][google.longrunning.Operation.metadata] field type is + [OptimizeToursLongRunningMetadata][google.maps.routeoptimization.v1.OptimizeToursUriMetadata]. + The [response][google.longrunning.Operation.response] field type + is + [OptimizeToursUriResponse][google.maps.routeoptimization.v1.OptimizeToursUriResponse], + if successful. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request + for more details. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.maps import routeoptimization_v1 + + async def sample_optimize_tours_uri(): + # Create a client + client = routeoptimization_v1.RouteOptimizationAsyncClient() + + # Initialize request argument(s) + request = routeoptimization_v1.OptimizeToursUriRequest( + parent="parent_value", + ) + + # Make the request + operation = client.optimize_tours_uri(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.maps.routeoptimization_v1.types.OptimizeToursUriRequest, dict]]): + The request object. A request used by the ``OptimizeToursUri`` method. + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.maps.routeoptimization_v1.types.OptimizeToursUriResponse` + A response returned by the OptimizeToursUri method. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, route_optimization_service.OptimizeToursUriRequest): + request = route_optimization_service.OptimizeToursUriRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.optimize_tours_uri + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + route_optimization_service.OptimizeToursUriResponse, + metadata_type=route_optimization_service.OptimizeToursUriMetadata, + ) + + # Done; return the response. + return response + async def get_operation( self, request: Optional[operations_pb2.GetOperationRequest] = None, diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/client.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/client.py index c8c0e20ccc2c..9c09e955bdec 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/client.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/client.py @@ -963,6 +963,258 @@ def sample_batch_optimize_tours(): # Done; return the response. return response + def optimize_tours_long_running( + self, + request: Optional[ + Union[route_optimization_service.OptimizeToursRequest, dict] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation.Operation: + r"""This is a variant of the + [OptimizeTours][google.maps.routeoptimization.v1.RouteOptimization.OptimizeTours] + method designed for optimizations with large timeout values. It + should be preferred over the ``OptimizeTours`` method for + optimizations that take longer than a few minutes. + + The returned [long-running + operation][google.longrunning.Operation] (LRO) will have a name + of the format ``/operations/`` and can be + used to track progress of the computation. The + [metadata][google.longrunning.Operation.metadata] field type is + [OptimizeToursLongRunningMetadata][google.maps.routeoptimization.v1.OptimizeToursLongRunningMetadata]. + The [response][google.longrunning.Operation.response] field type + is + [OptimizeToursResponse][google.maps.routeoptimization.v1.OptimizeToursResponse], + if successful. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request + for more details. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.maps import routeoptimization_v1 + + def sample_optimize_tours_long_running(): + # Create a client + client = routeoptimization_v1.RouteOptimizationClient() + + # Initialize request argument(s) + request = routeoptimization_v1.OptimizeToursRequest( + parent="parent_value", + ) + + # Make the request + operation = client.optimize_tours_long_running(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.maps.routeoptimization_v1.types.OptimizeToursRequest, dict]): + The request object. Request to be given to a tour + optimization solver which defines the + shipment model to solve as well as + optimization parameters. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.maps.routeoptimization_v1.types.OptimizeToursResponse` Response after solving a tour optimization problem containing the routes + followed by each vehicle, the shipments which have + been skipped and the overall cost of the solution. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, route_optimization_service.OptimizeToursRequest): + request = route_optimization_service.OptimizeToursRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.optimize_tours_long_running + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + route_optimization_service.OptimizeToursResponse, + metadata_type=route_optimization_service.OptimizeToursLongRunningMetadata, + ) + + # Done; return the response. + return response + + def optimize_tours_uri( + self, + request: Optional[ + Union[route_optimization_service.OptimizeToursUriRequest, dict] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation.Operation: + r"""This is a variant of the + [OptimizeToursLongRunning][google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursLongRunning] + method designed for optimizations with large timeout values and + large input/output sizes. + + The client specifies the URI of the ``OptimizeToursRequest`` + stored in Google Cloud Storage and the server writes the + ``OptimizeToursResponse`` to a client-specified Google Cloud + Storage URI. + + This method should be preferred over the ``OptimizeTours`` + method for optimizations that take longer than a few minutes and + input/output sizes that are larger than 8MB, though it can be + used for shorter and smaller optimizations as well. + + The returned [long-running + operation][google.longrunning.Operation] (LRO) will have a name + of the format ``/operations/`` and can be + used to track progress of the computation. The + [metadata][google.longrunning.Operation.metadata] field type is + [OptimizeToursLongRunningMetadata][google.maps.routeoptimization.v1.OptimizeToursUriMetadata]. + The [response][google.longrunning.Operation.response] field type + is + [OptimizeToursUriResponse][google.maps.routeoptimization.v1.OptimizeToursUriResponse], + if successful. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request + for more details. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.maps import routeoptimization_v1 + + def sample_optimize_tours_uri(): + # Create a client + client = routeoptimization_v1.RouteOptimizationClient() + + # Initialize request argument(s) + request = routeoptimization_v1.OptimizeToursUriRequest( + parent="parent_value", + ) + + # Make the request + operation = client.optimize_tours_uri(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.maps.routeoptimization_v1.types.OptimizeToursUriRequest, dict]): + The request object. A request used by the ``OptimizeToursUri`` method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.maps.routeoptimization_v1.types.OptimizeToursUriResponse` + A response returned by the OptimizeToursUri method. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, route_optimization_service.OptimizeToursUriRequest): + request = route_optimization_service.OptimizeToursUriRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.optimize_tours_uri] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + route_optimization_service.OptimizeToursUriResponse, + metadata_type=route_optimization_service.OptimizeToursUriMetadata, + ) + + # Done; return the response. + return response + def __enter__(self) -> "RouteOptimizationClient": return self diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/base.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/base.py index 53d05ae6c9a7..6cf6a6b7ce64 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/base.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/base.py @@ -153,6 +153,16 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.optimize_tours_long_running: gapic_v1.method.wrap_method( + self.optimize_tours_long_running, + default_timeout=None, + client_info=client_info, + ), + self.optimize_tours_uri: gapic_v1.method.wrap_method( + self.optimize_tours_uri, + default_timeout=None, + client_info=client_info, + ), self.get_operation: gapic_v1.method.wrap_method( self.get_operation, default_timeout=None, @@ -195,6 +205,24 @@ def batch_optimize_tours( ]: raise NotImplementedError() + @property + def optimize_tours_long_running( + self, + ) -> Callable[ + [route_optimization_service.OptimizeToursRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def optimize_tours_uri( + self, + ) -> Callable[ + [route_optimization_service.OptimizeToursUriRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + @property def get_operation( self, diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc.py index 6dbfa25d8657..1c58ce5eacb0 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc.py @@ -456,6 +456,111 @@ def batch_optimize_tours( ) return self._stubs["batch_optimize_tours"] + @property + def optimize_tours_long_running( + self, + ) -> Callable[ + [route_optimization_service.OptimizeToursRequest], operations_pb2.Operation + ]: + r"""Return a callable for the optimize tours long running method over gRPC. + + This is a variant of the + [OptimizeTours][google.maps.routeoptimization.v1.RouteOptimization.OptimizeTours] + method designed for optimizations with large timeout values. It + should be preferred over the ``OptimizeTours`` method for + optimizations that take longer than a few minutes. + + The returned [long-running + operation][google.longrunning.Operation] (LRO) will have a name + of the format ``/operations/`` and can be + used to track progress of the computation. The + [metadata][google.longrunning.Operation.metadata] field type is + [OptimizeToursLongRunningMetadata][google.maps.routeoptimization.v1.OptimizeToursLongRunningMetadata]. + The [response][google.longrunning.Operation.response] field type + is + [OptimizeToursResponse][google.maps.routeoptimization.v1.OptimizeToursResponse], + if successful. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request + for more details. + + Returns: + Callable[[~.OptimizeToursRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "optimize_tours_long_running" not in self._stubs: + self._stubs[ + "optimize_tours_long_running" + ] = self._logged_channel.unary_unary( + "/google.maps.routeoptimization.v1.RouteOptimization/OptimizeToursLongRunning", + request_serializer=route_optimization_service.OptimizeToursRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["optimize_tours_long_running"] + + @property + def optimize_tours_uri( + self, + ) -> Callable[ + [route_optimization_service.OptimizeToursUriRequest], operations_pb2.Operation + ]: + r"""Return a callable for the optimize tours uri method over gRPC. + + This is a variant of the + [OptimizeToursLongRunning][google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursLongRunning] + method designed for optimizations with large timeout values and + large input/output sizes. + + The client specifies the URI of the ``OptimizeToursRequest`` + stored in Google Cloud Storage and the server writes the + ``OptimizeToursResponse`` to a client-specified Google Cloud + Storage URI. + + This method should be preferred over the ``OptimizeTours`` + method for optimizations that take longer than a few minutes and + input/output sizes that are larger than 8MB, though it can be + used for shorter and smaller optimizations as well. + + The returned [long-running + operation][google.longrunning.Operation] (LRO) will have a name + of the format ``/operations/`` and can be + used to track progress of the computation. The + [metadata][google.longrunning.Operation.metadata] field type is + [OptimizeToursLongRunningMetadata][google.maps.routeoptimization.v1.OptimizeToursUriMetadata]. + The [response][google.longrunning.Operation.response] field type + is + [OptimizeToursUriResponse][google.maps.routeoptimization.v1.OptimizeToursUriResponse], + if successful. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request + for more details. + + Returns: + Callable[[~.OptimizeToursUriRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "optimize_tours_uri" not in self._stubs: + self._stubs["optimize_tours_uri"] = self._logged_channel.unary_unary( + "/google.maps.routeoptimization.v1.RouteOptimization/OptimizeToursUri", + request_serializer=route_optimization_service.OptimizeToursUriRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["optimize_tours_uri"] + def close(self): self._logged_channel.close() diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc_asyncio.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc_asyncio.py index f59e622e3c93..fb481b838c15 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc_asyncio.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc_asyncio.py @@ -465,6 +465,113 @@ def batch_optimize_tours( ) return self._stubs["batch_optimize_tours"] + @property + def optimize_tours_long_running( + self, + ) -> Callable[ + [route_optimization_service.OptimizeToursRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the optimize tours long running method over gRPC. + + This is a variant of the + [OptimizeTours][google.maps.routeoptimization.v1.RouteOptimization.OptimizeTours] + method designed for optimizations with large timeout values. It + should be preferred over the ``OptimizeTours`` method for + optimizations that take longer than a few minutes. + + The returned [long-running + operation][google.longrunning.Operation] (LRO) will have a name + of the format ``/operations/`` and can be + used to track progress of the computation. The + [metadata][google.longrunning.Operation.metadata] field type is + [OptimizeToursLongRunningMetadata][google.maps.routeoptimization.v1.OptimizeToursLongRunningMetadata]. + The [response][google.longrunning.Operation.response] field type + is + [OptimizeToursResponse][google.maps.routeoptimization.v1.OptimizeToursResponse], + if successful. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request + for more details. + + Returns: + Callable[[~.OptimizeToursRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "optimize_tours_long_running" not in self._stubs: + self._stubs[ + "optimize_tours_long_running" + ] = self._logged_channel.unary_unary( + "/google.maps.routeoptimization.v1.RouteOptimization/OptimizeToursLongRunning", + request_serializer=route_optimization_service.OptimizeToursRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["optimize_tours_long_running"] + + @property + def optimize_tours_uri( + self, + ) -> Callable[ + [route_optimization_service.OptimizeToursUriRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the optimize tours uri method over gRPC. + + This is a variant of the + [OptimizeToursLongRunning][google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursLongRunning] + method designed for optimizations with large timeout values and + large input/output sizes. + + The client specifies the URI of the ``OptimizeToursRequest`` + stored in Google Cloud Storage and the server writes the + ``OptimizeToursResponse`` to a client-specified Google Cloud + Storage URI. + + This method should be preferred over the ``OptimizeTours`` + method for optimizations that take longer than a few minutes and + input/output sizes that are larger than 8MB, though it can be + used for shorter and smaller optimizations as well. + + The returned [long-running + operation][google.longrunning.Operation] (LRO) will have a name + of the format ``/operations/`` and can be + used to track progress of the computation. The + [metadata][google.longrunning.Operation.metadata] field type is + [OptimizeToursLongRunningMetadata][google.maps.routeoptimization.v1.OptimizeToursUriMetadata]. + The [response][google.longrunning.Operation.response] field type + is + [OptimizeToursUriResponse][google.maps.routeoptimization.v1.OptimizeToursUriResponse], + if successful. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request + for more details. + + Returns: + Callable[[~.OptimizeToursUriRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "optimize_tours_uri" not in self._stubs: + self._stubs["optimize_tours_uri"] = self._logged_channel.unary_unary( + "/google.maps.routeoptimization.v1.RouteOptimization/OptimizeToursUri", + request_serializer=route_optimization_service.OptimizeToursUriRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["optimize_tours_uri"] + def _prep_wrapped_messages(self, client_info): """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" self._wrapped_methods = { @@ -487,6 +594,16 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.optimize_tours_long_running: self._wrap_method( + self.optimize_tours_long_running, + default_timeout=None, + client_info=client_info, + ), + self.optimize_tours_uri: self._wrap_method( + self.optimize_tours_uri, + default_timeout=None, + client_info=client_info, + ), self.get_operation: self._wrap_method( self.get_operation, default_timeout=None, diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/rest.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/rest.py index b4697165ef61..feefd491fab2 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/rest.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/rest.py @@ -89,6 +89,22 @@ def post_optimize_tours(self, response): logging.log(f"Received response: {response}") return response + def pre_optimize_tours_long_running(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_optimize_tours_long_running(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_optimize_tours_uri(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_optimize_tours_uri(self, response): + logging.log(f"Received response: {response}") + return response + transport = RouteOptimizationRestTransport(interceptor=MyCustomRouteOptimizationInterceptor()) client = RouteOptimizationClient(transport=transport) @@ -196,6 +212,104 @@ def post_optimize_tours_with_metadata( """ return response, metadata + def pre_optimize_tours_long_running( + self, + request: route_optimization_service.OptimizeToursRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + route_optimization_service.OptimizeToursRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for optimize_tours_long_running + + Override in a subclass to manipulate the request or metadata + before they are sent to the RouteOptimization server. + """ + return request, metadata + + def post_optimize_tours_long_running( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for optimize_tours_long_running + + DEPRECATED. Please use the `post_optimize_tours_long_running_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the RouteOptimization server but before + it is returned to user code. This `post_optimize_tours_long_running` interceptor runs + before the `post_optimize_tours_long_running_with_metadata` interceptor. + """ + return response + + def post_optimize_tours_long_running_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for optimize_tours_long_running + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the RouteOptimization server but before it is returned to user code. + + We recommend only using this `post_optimize_tours_long_running_with_metadata` + interceptor in new development instead of the `post_optimize_tours_long_running` interceptor. + When both interceptors are used, this `post_optimize_tours_long_running_with_metadata` interceptor runs after the + `post_optimize_tours_long_running` interceptor. The (possibly modified) response returned by + `post_optimize_tours_long_running` will be passed to + `post_optimize_tours_long_running_with_metadata`. + """ + return response, metadata + + def pre_optimize_tours_uri( + self, + request: route_optimization_service.OptimizeToursUriRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + route_optimization_service.OptimizeToursUriRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for optimize_tours_uri + + Override in a subclass to manipulate the request or metadata + before they are sent to the RouteOptimization server. + """ + return request, metadata + + def post_optimize_tours_uri( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for optimize_tours_uri + + DEPRECATED. Please use the `post_optimize_tours_uri_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the RouteOptimization server but before + it is returned to user code. This `post_optimize_tours_uri` interceptor runs + before the `post_optimize_tours_uri_with_metadata` interceptor. + """ + return response + + def post_optimize_tours_uri_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for optimize_tours_uri + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the RouteOptimization server but before it is returned to user code. + + We recommend only using this `post_optimize_tours_uri_with_metadata` + interceptor in new development instead of the `post_optimize_tours_uri` interceptor. + When both interceptors are used, this `post_optimize_tours_uri_with_metadata` interceptor runs after the + `post_optimize_tours_uri` interceptor. The (possibly modified) response returned by + `post_optimize_tours_uri` will be passed to + `post_optimize_tours_uri_with_metadata`. + """ + return response, metadata + def pre_get_operation( self, request: operations_pb2.GetOperationRequest, @@ -688,6 +802,320 @@ def __call__( ) return resp + class _OptimizeToursLongRunning( + _BaseRouteOptimizationRestTransport._BaseOptimizeToursLongRunning, + RouteOptimizationRestStub, + ): + def __hash__(self): + return hash("RouteOptimizationRestTransport.OptimizeToursLongRunning") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: route_optimization_service.OptimizeToursRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the optimize tours long + running method over HTTP. + + Args: + request (~.route_optimization_service.OptimizeToursRequest): + The request object. Request to be given to a tour + optimization solver which defines the + shipment model to solve as well as + optimization parameters. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseRouteOptimizationRestTransport._BaseOptimizeToursLongRunning._get_http_options() + ) + + request, metadata = self._interceptor.pre_optimize_tours_long_running( + request, metadata + ) + transcoded_request = _BaseRouteOptimizationRestTransport._BaseOptimizeToursLongRunning._get_transcoded_request( + http_options, request + ) + + body = _BaseRouteOptimizationRestTransport._BaseOptimizeToursLongRunning._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseRouteOptimizationRestTransport._BaseOptimizeToursLongRunning._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.maps.routeoptimization_v1.RouteOptimizationClient.OptimizeToursLongRunning", + extra={ + "serviceName": "google.maps.routeoptimization.v1.RouteOptimization", + "rpcName": "OptimizeToursLongRunning", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + RouteOptimizationRestTransport._OptimizeToursLongRunning._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = operations_pb2.Operation() + json_format.Parse(response.content, resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_optimize_tours_long_running(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_optimize_tours_long_running_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.maps.routeoptimization_v1.RouteOptimizationClient.optimize_tours_long_running", + extra={ + "serviceName": "google.maps.routeoptimization.v1.RouteOptimization", + "rpcName": "OptimizeToursLongRunning", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _OptimizeToursUri( + _BaseRouteOptimizationRestTransport._BaseOptimizeToursUri, + RouteOptimizationRestStub, + ): + def __hash__(self): + return hash("RouteOptimizationRestTransport.OptimizeToursUri") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: route_optimization_service.OptimizeToursUriRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the optimize tours uri method over HTTP. + + Args: + request (~.route_optimization_service.OptimizeToursUriRequest): + The request object. A request used by the ``OptimizeToursUri`` method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseRouteOptimizationRestTransport._BaseOptimizeToursUri._get_http_options() + ) + + request, metadata = self._interceptor.pre_optimize_tours_uri( + request, metadata + ) + transcoded_request = _BaseRouteOptimizationRestTransport._BaseOptimizeToursUri._get_transcoded_request( + http_options, request + ) + + body = _BaseRouteOptimizationRestTransport._BaseOptimizeToursUri._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseRouteOptimizationRestTransport._BaseOptimizeToursUri._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.maps.routeoptimization_v1.RouteOptimizationClient.OptimizeToursUri", + extra={ + "serviceName": "google.maps.routeoptimization.v1.RouteOptimization", + "rpcName": "OptimizeToursUri", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = RouteOptimizationRestTransport._OptimizeToursUri._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = operations_pb2.Operation() + json_format.Parse(response.content, resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_optimize_tours_uri(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_optimize_tours_uri_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.maps.routeoptimization_v1.RouteOptimizationClient.optimize_tours_uri", + extra={ + "serviceName": "google.maps.routeoptimization.v1.RouteOptimization", + "rpcName": "OptimizeToursUri", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + @property def batch_optimize_tours( self, @@ -709,6 +1137,26 @@ def optimize_tours( # In C++ this would require a dynamic_cast return self._OptimizeTours(self._session, self._host, self._interceptor) # type: ignore + @property + def optimize_tours_long_running( + self, + ) -> Callable[ + [route_optimization_service.OptimizeToursRequest], operations_pb2.Operation + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._OptimizeToursLongRunning(self._session, self._host, self._interceptor) # type: ignore + + @property + def optimize_tours_uri( + self, + ) -> Callable[ + [route_optimization_service.OptimizeToursUriRequest], operations_pb2.Operation + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._OptimizeToursUri(self._session, self._host, self._interceptor) # type: ignore + @property def get_operation(self): return self._GetOperation(self._session, self._host, self._interceptor) # type: ignore diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/rest_base.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/rest_base.py index b3b3eb238856..e7a8757bcddd 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/rest_base.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/services/route_optimization/transports/rest_base.py @@ -214,6 +214,130 @@ def _get_query_params_json(transcoded_request): query_params["$alt"] = "json;enum-encoding=int" return query_params + class _BaseOptimizeToursLongRunning: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1/{parent=projects/*/locations/*}:optimizeToursLongRunning", + "body": "*", + }, + { + "method": "post", + "uri": "/v1/{parent=projects/*}:optimizeToursLongRunning", + "body": "*", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = route_optimization_service.OptimizeToursRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=True + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseRouteOptimizationRestTransport._BaseOptimizeToursLongRunning._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + + class _BaseOptimizeToursUri: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1/{parent=projects/*/locations/*}:OptimizeToursUri", + "body": "*", + }, + { + "method": "post", + "uri": "/v1/{parent=projects/*}:OptimizeToursUri", + "body": "*", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = route_optimization_service.OptimizeToursUriRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=True + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseRouteOptimizationRestTransport._BaseOptimizeToursUri._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + class _BaseGetOperation: def __hash__(self): # pragma: NO COVER return NotImplementedError("__hash__ must be implemented.") diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/types/__init__.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/types/__init__.py index d6eaf7173284..d123a1ba77c7 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/types/__init__.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/types/__init__.py @@ -26,8 +26,12 @@ InjectedSolutionConstraint, InputConfig, Location, + OptimizeToursLongRunningMetadata, OptimizeToursRequest, OptimizeToursResponse, + OptimizeToursUriMetadata, + OptimizeToursUriRequest, + OptimizeToursUriResponse, OptimizeToursValidationError, OutputConfig, RouteModifiers, @@ -39,7 +43,9 @@ SkippedShipment, TimeWindow, TransitionAttributes, + Uri, Vehicle, + VehicleFullness, Waypoint, ) @@ -55,8 +61,12 @@ "InjectedSolutionConstraint", "InputConfig", "Location", + "OptimizeToursLongRunningMetadata", "OptimizeToursRequest", "OptimizeToursResponse", + "OptimizeToursUriMetadata", + "OptimizeToursUriRequest", + "OptimizeToursUriResponse", "OptimizeToursValidationError", "OutputConfig", "RouteModifiers", @@ -68,7 +78,9 @@ "SkippedShipment", "TimeWindow", "TransitionAttributes", + "Uri", "Vehicle", + "VehicleFullness", "Waypoint", "DataFormat", ) diff --git a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/types/route_optimization_service.py b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/types/route_optimization_service.py index 58c36c9f6998..5e5f6e82cd43 100644 --- a/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/types/route_optimization_service.py +++ b/packages/google-maps-routeoptimization/google/maps/routeoptimization_v1/types/route_optimization_service.py @@ -26,9 +26,14 @@ package="google.maps.routeoptimization.v1", manifest={ "DataFormat", + "Uri", + "OptimizeToursUriRequest", + "OptimizeToursUriResponse", + "OptimizeToursUriMetadata", "BatchOptimizeToursRequest", "BatchOptimizeToursResponse", "BatchOptimizeToursMetadata", + "OptimizeToursLongRunningMetadata", "OptimizeToursRequest", "OptimizeToursResponse", "ShipmentModel", @@ -46,6 +51,7 @@ "ShipmentRoute", "SkippedShipment", "AggregatedMetrics", + "VehicleFullness", "InjectedSolutionConstraint", "OptimizeToursValidationError", "InputConfig", @@ -74,6 +80,95 @@ class DataFormat(proto.Enum): PROTO_TEXT = 2 +class Uri(proto.Message): + r"""A Universal Resource Identifier that points to a resource + that can be read and written by the Route Optimization API. + + Attributes: + uri (str): + The URI of the resource. The resource may not yet exist. + + The contents of the resource are encoded as either JSON or + textproto. Only Google Cloud Storage resources are + supported. If the resource is encoded as JSON, the resource + name must be suffixed with ``.json``. If the resource is + encoded as textproto, the resource name must be suffixed + with ``.txtpb``. For example, a Google Cloud Storage URI to + a JSON encoded file might look like: + ``gs://bucket/path/input/object.json``. + """ + + uri: str = proto.Field( + proto.STRING, + number=1, + ) + + +class OptimizeToursUriRequest(proto.Message): + r"""A request used by the ``OptimizeToursUri`` method. + + Attributes: + parent (str): + Required. Target project or location to make a call. + + Format: + + - ``projects/{project-id}`` + - ``projects/{project-id}/locations/{location-id}`` + + If no location is specified, a region will be chosen + automatically. + input (google.maps.routeoptimization_v1.types.Uri): + Required. The URI of the Cloud Storage object containing the + ``OptimizeToursRequest``. + output (google.maps.routeoptimization_v1.types.Uri): + Required. The URI of the Cloud Storage object that will + contain the ``OptimizeToursResponse``. + """ + + parent: str = proto.Field( + proto.STRING, + number=1, + ) + input: "Uri" = proto.Field( + proto.MESSAGE, + number=2, + message="Uri", + ) + output: "Uri" = proto.Field( + proto.MESSAGE, + number=3, + message="Uri", + ) + + +class OptimizeToursUriResponse(proto.Message): + r"""A response returned by the ``OptimizeToursUri`` method. + + Attributes: + output (google.maps.routeoptimization_v1.types.Uri): + Optional. The URI of the Cloud Storage object containing the + ``OptimizeToursResponse`` encoded as either JSON or + textproto. If the object was encoded as JSON, the extension + of the object name will be ``.json``. If the object was + encoded as textproto, the extension of the object name will + be ``.txtpb``. + + The ``crc32_checksum`` of the resource can be used to verify + the contents of the resource have not been modified. + """ + + output: "Uri" = proto.Field( + proto.MESSAGE, + number=1, + message="Uri", + ) + + +class OptimizeToursUriMetadata(proto.Message): + r"""Operation metadata for ``OptimizeToursUri`` calls.""" + + class BatchOptimizeToursRequest(proto.Message): r"""Request to batch optimize tours as an asynchronous operation. Each input file should contain one ``OptimizeToursRequest``, and each @@ -150,6 +245,10 @@ class BatchOptimizeToursMetadata(proto.Message): r"""Operation metadata for ``BatchOptimizeToursRequest`` calls.""" +class OptimizeToursLongRunningMetadata(proto.Message): + r"""Operation metadata for ``OptimizeToursLongRunning`` calls.""" + + class OptimizeToursRequest(proto.Message): r"""Request to be given to a tour optimization solver which defines the shipment model to solve as well as optimization @@ -408,10 +507,22 @@ class SolvingMode(proto.Enum): *IMPORTANT*: not all infeasible shipments are returned here, but only the ones that are detected as infeasible during preprocessing. + TRANSFORM_AND_RETURN_REQUEST (3): + This mode only works if ``ShipmentModel.objectives`` is not + empty. The request is not solved. It is only validated and + filled with costs corresponding to the given objectives. + Also see the documentation of ``ShipmentModel.objectives``. + The resulting request is returned as + ``OptimizeToursResponse.processed_request``. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request + for more details. """ DEFAULT_SOLVE = 0 VALIDATE_ONLY = 1 DETECT_SOME_INFEASIBLE_SHIPMENTS = 2 + TRANSFORM_AND_RETURN_REQUEST = 3 class SearchMode(proto.Enum): r"""Mode defining the behavior of the search, trading off latency @@ -536,6 +647,15 @@ class OptimizeToursResponse(proto.Message): [OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError] message. Instead of errors, this will include warnings in the case ``solving_mode`` is ``DEFAULT_SOLVE``. + processed_request (google.maps.routeoptimization_v1.types.OptimizeToursRequest): + In some cases we modify the incoming request before solving + it, i.e. adding costs. If solving_mode == + TRANSFORM_AND_RETURN_REQUEST, the modified request is + returned here. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request + for more details. metrics (google.maps.routeoptimization_v1.types.OptimizeToursResponse.Metrics): Duration, distance and usage metrics for this solution. @@ -636,6 +756,11 @@ class Metrics(proto.Message): number=5, message="OptimizeToursValidationError", ) + processed_request: "OptimizeToursRequest" = proto.Field( + proto.MESSAGE, + number=21, + message="OptimizeToursRequest", + ) metrics: Metrics = proto.Field( proto.MESSAGE, number=6, @@ -663,6 +788,17 @@ class ShipmentModel(proto.Message): vehicles (MutableSequence[google.maps.routeoptimization_v1.types.Vehicle]): Set of vehicles which can be used to perform visits. + objectives (MutableSequence[google.maps.routeoptimization_v1.types.ShipmentModel.Objective]): + The set of objectives for this model, that we will transform + into costs. If not empty, the input model has to be + costless. To obtain the modified request, please use + ``solving_mode`` = TRANSFORM_AND_RETURN_REQUEST. Note that + the request will not be solved in this case. See + corresponding documentation. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request + for more details. max_active_vehicles (int): Constrains the maximum number of active vehicles. A vehicle is active if its route @@ -835,10 +971,81 @@ class ShipmentModel(proto.Message): Sets of ``shipment_type`` requirements (see ``ShipmentTypeRequirement``). precedence_rules (MutableSequence[google.maps.routeoptimization_v1.types.ShipmentModel.PrecedenceRule]): - Set of precedence rules which must be - enforced in the model. + Set of precedence rules which must be enforced in the model. + + *IMPORTANT*: Use of precedence rules limits the size of + problem that can be optimized. Requests using precedence + rules that include many shipments may be rejected. """ + class Objective(proto.Message): + r"""Objectives replace the cost model completely, and are + therefore incompatible with pre-existing costs. Each objective + maps to a number of pre-defined costs for, e.g., vehicles, + shipments or transition attributes. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request + for more details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + type_ (google.maps.routeoptimization_v1.types.ShipmentModel.Objective.Type): + The type of the objective. + + This field is a member of `oneof`_ ``_type``. + weight (float): + How much this objective should count + relatively to the others. This can be any + non-negative number, weights do not have to sum + to 1. Weights default to 1.0. + + This field is a member of `oneof`_ ``_weight``. + """ + + class Type(proto.Enum): + r"""The objective type that will be mapped to a set of costs. + + Values: + DEFAULT (0): + A default set of costs will be used, to + ensure a reasonable solution. Note: this + objective can be used on its own, but will also + always be added with weight 1.0, as a baseline, + to the objectives specified by the user, if it's + not already present. + MIN_DISTANCE (10): + "MIN" objectives. + Minimize the total distance traveled. + MIN_WORKING_TIME (11): + Minimize the total working time, summed over + all vehicles. + MIN_TRAVEL_TIME (12): + Same as above but focusing on travel time + only. + MIN_NUM_VEHICLES (13): + Minimize the number of vehicles used. + """ + DEFAULT = 0 + MIN_DISTANCE = 10 + MIN_WORKING_TIME = 11 + MIN_TRAVEL_TIME = 12 + MIN_NUM_VEHICLES = 13 + + type_: "ShipmentModel.Objective.Type" = proto.Field( + proto.ENUM, + number=1, + optional=True, + enum="ShipmentModel.Objective.Type", + ) + weight: float = proto.Field( + proto.DOUBLE, + number=2, + optional=True, + ) + class DurationDistanceMatrix(proto.Message): r"""Specifies a duration and distance matrix from visit and vehicle start locations to visit and vehicle end locations. @@ -966,6 +1173,11 @@ class PrecedenceRule(proto.Message): number=2, message="Vehicle", ) + objectives: MutableSequence[Objective] = proto.RepeatedField( + proto.MESSAGE, + number=17, + message=Objective, + ) max_active_vehicles: int = proto.Field( proto.INT32, number=4, @@ -1191,6 +1403,9 @@ class VisitRequest(proto.Message): spent by the vehicle once it has arrived to pickup or drop off goods). + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: arrival_location (google.type.latlng_pb2.LatLng): The geo-location where the vehicle arrives when performing @@ -1265,6 +1480,19 @@ class VisitRequest(proto.Message): reported in the response as ``visit_label`` in the corresponding [ShipmentRoute.Visit][google.maps.routeoptimization.v1.ShipmentRoute.Visit]. + avoid_u_turns (bool): + Specifies whether U-turns should be avoided + in driving routes at this location. + U-turn avoidance is best effort and complete + avoidance is not guaranteed. This is an + experimental feature and behavior is subject to + change. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/u-turn-avoidance/make-request + for more details. + + This field is a member of `oneof`_ ``_avoid_u_turns``. """ arrival_location: latlng_pb2.LatLng = proto.Field( @@ -1319,6 +1547,11 @@ class VisitRequest(proto.Message): proto.STRING, number=11, ) + avoid_u_turns: bool = proto.Field( + proto.BOOL, + number=13, + optional=True, + ) class Load(proto.Message): r"""When performing a visit, a predefined amount may be added to the @@ -1431,16 +1664,14 @@ class IncompatibilityMode(proto.Enum): In this mode, two shipments with incompatible types can never share the same vehicle. NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY (2): - For two shipments with incompatible types with the - ``NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY`` incompatibility mode: - - - If both are pickups only (no deliveries) or deliveries - only (no pickups), they cannot share the same vehicle at - all. - - If one of the shipments has a delivery and the other a - pickup, the two shipments can share the same vehicle iff - the former shipment is delivered before the latter is - picked up. + In this mode, two shipments with incompatible types can + never be on the same vehicle at the same time: + + - They can share the same vehicle only if one is delivered + before the other is picked up. + - When both shipments are pickups-only (no deliveries) or + deliveries-only (no pickups), they can't share the same + vehicle at all. """ INCOMPATIBILITY_MODE_UNSPECIFIED = 0 NOT_PERFORMED_BY_SAME_VEHICLE = 1 @@ -1785,9 +2016,13 @@ class Vehicle(proto.Message): class TravelMode(proto.Enum): r"""Travel modes which can be used by vehicles. - These should be a subset of the Google Maps Platform Routes - Preferred API travel modes, see: - https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/RouteTravelMode. + These should be a subset of the Google Maps Platform Routes API + travel modes, see: + https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode + + Note: ``WALKING`` routes are in beta and might sometimes be missing + clear sidewalks or pedestrian paths. You must display this warning + to the user for all walking routes that you display in your app. Values: TRAVEL_MODE_UNSPECIFIED (0): @@ -1851,12 +2086,34 @@ class LoadLimit(proto.Message): - [cost_per_unit_above_soft_max][google.maps.routeoptimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs add up and must be in the same unit as [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost]. + Soft limits may only be defined on types that apply to + either pickups only or deliveries only throughout the + model. start_load_interval (google.maps.routeoptimization_v1.types.Vehicle.LoadLimit.Interval): The acceptable load interval of the vehicle at the start of the route. end_load_interval (google.maps.routeoptimization_v1.types.Vehicle.LoadLimit.Interval): The acceptable load interval of the vehicle at the end of the route. + cost_per_kilometer (google.maps.routeoptimization_v1.types.Vehicle.LoadLimit.LoadCost): + Cost of moving one unit of load over one kilometer for this + vehicle. This can be used as a proxy for fuel consumption: + if the load is a weight (in Newtons), then load*kilometer + has the dimension of an energy. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request + for more details. + + This field is a member of `oneof`_ ``_cost_per_kilometer``. + cost_per_traveled_hour (google.maps.routeoptimization_v1.types.Vehicle.LoadLimit.LoadCost): + Cost of traveling with a unit of load during + one hour for this vehicle. + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request + for more details. + + This field is a member of `oneof`_ ``_cost_per_traveled_hour``. """ class Interval(proto.Message): @@ -1892,6 +2149,131 @@ class Interval(proto.Message): optional=True, ) + class LoadCost(proto.Message): + r"""Cost of moving one unit of load during a ``Transition``. For a given + load, the cost is the sum of two parts: + + - min(load, ``load_threshold``) \* ``cost_per_unit_below_threshold`` + - max(0, load - ``load_threshold``) \* + ``cost_per_unit_above_threshold`` + + With this cost, solutions prefer to deliver high demands first, or + equivalently pickup high demands last. For example, if a vehicle has + + :: + + load_limit { + key: "weight" + value { + cost_per_kilometer { + load_threshold: 15 + cost_per_unit_below_threshold: 2.0 + cost_per_unit_above_threshold: 10.0 + } + } + } + + and its route is start,pickup,pickup,delivery,delivery,end with + transitions: + + :: + + transition { vehicle_load['weight'] { amount: 0 } + travel_distance_meters: 1000.0 } + transition { vehicle_load['weight'] { amount: 10 } + travel_distance_meters: 1000.0 } + transition { vehicle_load['weight'] { amount: 20 } + travel_distance_meters: 1000.0 } + transition { vehicle_load['weight'] { amount: 10 } + travel_distance_meters: 1000.0 } + transition { vehicle_load['weight'] { amount: 0 } + travel_distance_meters: 1000.0 } + + then the cost incurred by this ``LoadCost`` is (cost_below \* + load_below \* kilometers + cost_above \* load_above \* kms) + + - transition 0: 0.0 + - transition 1: 2.0 \* 10 \* 1.0 + 10.0 \* 0 \* 1.0 = 20.0 + - transition 2: 2.0 \* 15 \* 1.0 + 10.0 \* (20 - 15) \* 1.0 = 80.0 + - transition 3: 2.0 \* 10 \* 1.0 + 10.0 \* 0 \* 1.0 = 20.0 + - transition 4: 0.0 + + So the ``LoadCost`` over the route is 120.0. + + However, if the route is start,pickup,delivery,pickup,delivery,end + with transitions: + + :: + + transition { vehicle_load['weight'] { amount: 0 } + travel_distance_meters: 1000.0 } + transition { vehicle_load['weight'] { amount: 10 } + travel_distance_meters: 1000.0 } + transition { vehicle_load['weight'] { amount: 0 } + travel_distance_meters: 1000.0 } + transition { vehicle_load['weight'] { amount: 10 } + travel_distance_meters: 1000.0 } + transition { vehicle_load['weight'] { amount: 0 } + travel_distance_meters: 1000.0 } + + then the cost incurred by this ``LoadCost`` is + + - transition 0: 0.0 + - transition 1: 2.0 \* 10 \* 1.0 + 10.0 \* 0 \* 1.0 = 20.0 + - transition 2: 0.0 + - transition 3: 2.0 \* 10 \* 1.0 + 10.0 \* 0 \* 1.0 = 20.0 + - transition 4: 0.0 + + Here the ``LoadCost`` over the route is 40.0. + + ``LoadCost`` makes solutions with heavy-loaded transitions more + expensive. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request + for more details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + load_threshold (int): + Amount of load above which the cost of moving a unit of load + changes from cost_per_unit_below_threshold to + cost_per_unit_above_threshold. Must be >= 0. + + This field is a member of `oneof`_ ``_load_threshold``. + cost_per_unit_below_threshold (float): + Cost of moving a unit of load, for each unit + between 0 and threshold. Must be a finite value, + and >= 0. + + This field is a member of `oneof`_ ``_cost_per_unit_below_threshold``. + cost_per_unit_above_threshold (float): + Cost of moving a unit of load, for each unit + above threshold. In the special case threshold = + 0, this is a fixed cost per unit. Must be a + finite value, and >= 0. + + This field is a member of `oneof`_ ``_cost_per_unit_above_threshold``. + """ + + load_threshold: int = proto.Field( + proto.INT64, + number=1, + optional=True, + ) + cost_per_unit_below_threshold: float = proto.Field( + proto.DOUBLE, + number=2, + optional=True, + ) + cost_per_unit_above_threshold: float = proto.Field( + proto.DOUBLE, + number=3, + optional=True, + ) + max_load: int = proto.Field( proto.INT64, number=1, @@ -1915,6 +2297,18 @@ class Interval(proto.Message): number=5, message="Vehicle.LoadLimit.Interval", ) + cost_per_kilometer: "Vehicle.LoadLimit.LoadCost" = proto.Field( + proto.MESSAGE, + number=6, + optional=True, + message="Vehicle.LoadLimit.LoadCost", + ) + cost_per_traveled_hour: "Vehicle.LoadLimit.LoadCost" = proto.Field( + proto.MESSAGE, + number=7, + optional=True, + message="Vehicle.LoadLimit.LoadCost", + ) class DurationLimit(proto.Message): r"""A limit defining a maximum duration of the route of a @@ -2424,8 +2818,15 @@ class Waypoint(proto.Message): This field is a member of `oneof`_ ``location_type``. place_id (str): - The POI Place ID associated with the + The POI place ID associated with the waypoint. + When using a place ID to specify arrival or + departure location of a VisitRequest, use a + place ID that is specific enough to determine a + LatLng location for navigation to the place. + For example, a place ID representing a building + is suitable, but a place ID representing a road + is discouraged. This field is a member of `oneof`_ ``location_type``. side_of_road (bool): @@ -2438,6 +2839,14 @@ class Waypoint(proto.Message): biased towards from the center of the road. This option doesn't work for the 'WALKING' travel mode. + vehicle_stopover (bool): + Indicates that the waypoint is meant for vehicles to stop + at, where the intention is to either pick up or drop off. + This option works only for the 'DRIVING' travel mode, and + when the 'location_type' is 'location'. + + Experimental: This field's behavior or existence may change + in future. """ location: "Location" = proto.Field( @@ -2455,6 +2864,10 @@ class Waypoint(proto.Message): proto.BOOL, number=3, ) + vehicle_stopover: bool = proto.Field( + proto.BOOL, + number=4, + ) class Location(proto.Message): @@ -2775,6 +3188,17 @@ class ShipmentRoute(proto.Message): or [ShipmentRoute.visits][google.maps.routeoptimization.v1.ShipmentRoute.visits], depending on the context. + vehicle_fullness (google.maps.routeoptimization_v1.types.VehicleFullness): + [VehicleFullness][google.maps.routeoptimization.v1.VehicleFullness] + field for computing how close the capped metrics are to + their respective vehicle limits. Its fields are ratios + between a capped metric field (e.g. + [AggregatedMetrics.travel_distance_meters][google.maps.routeoptimization.v1.AggregatedMetrics.travel_distance_meters]) + and the related vehicle limit (e.g. + [Vehicle.route_distance_limit][google.maps.routeoptimization.v1.Vehicle.route_distance_limit]). + + Experimental: This field's behavior or existence may change + in future. route_costs (MutableMapping[str, float]): Cost of the route, broken down by cost-related request fields. The keys are proto paths, relative to the input @@ -2795,6 +3219,9 @@ class Visit(proto.Message): r"""A visit performed during a route. This visit corresponds to a pickup or a delivery of a ``Shipment``. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: shipment_index (int): Index of the ``shipments`` field in the source @@ -2843,6 +3270,23 @@ class Visit(proto.Message): Copy of the corresponding [VisitRequest.label][google.maps.routeoptimization.v1.Shipment.VisitRequest.label], if specified in the ``VisitRequest``. + injected_solution_location_token (int): + An opaque token representing information about a visit + location. + + This field may be populated in the result routes' visits + when + [VisitRequest.avoid_u_turns][google.maps.routeoptimization.v1.Shipment.VisitRequest.avoid_u_turns] + was set to true for this visit or if + [ShipmentModel.avoid_u_turns][google.maps.routeoptimization.v1.ShipmentModel.avoid_u_turns] + was set to true in the request + [OptimizeToursRequest][google.maps.routeoptimization.v1.OptimizeToursRequest]. + + Experimental: See + https://developers.google.com/maps/tt/route-optimization/experimental/u-turn-avoidance/make-request + for more details. + + This field is a member of `oneof`_ ``_injected_solution_location_token``. """ shipment_index: int = proto.Field( @@ -2881,6 +3325,11 @@ class Visit(proto.Message): proto.STRING, number=8, ) + injected_solution_location_token: int = proto.Field( + proto.INT32, + number=13, + optional=True, + ) class Transition(proto.Message): r"""Transition between two events on the route. See the description of @@ -3124,6 +3573,11 @@ class Break(proto.Message): number=12, message="AggregatedMetrics", ) + vehicle_fullness: "VehicleFullness" = proto.Field( + proto.MESSAGE, + number=20, + message="VehicleFullness", + ) route_costs: MutableMapping[str, float] = proto.MapField( proto.STRING, proto.DOUBLE, @@ -3140,6 +3594,9 @@ class SkippedShipment(proto.Message): trivial cases and/or if we are able to identify the cause for skipping, we report the reason here. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: index (int): The index corresponds to the index of the shipment in the @@ -3148,6 +3605,26 @@ class SkippedShipment(proto.Message): Copy of the corresponding [Shipment.label][google.maps.routeoptimization.v1.Shipment.label], if specified in the ``Shipment``. + penalty_cost (float): + This is a copy of the + [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost], + included here to make it easier to see the severity of a + skipped shipment. + + Experimental: This field's behavior or existence may change + in future. + + This field is a member of `oneof`_ ``_penalty_cost``. + estimated_incompatible_vehicle_ratio (float): + Estimated ratio of vehicles that cannot + perform this shipment for at least one of the + reasons below. Note: this is only filled when + reasons involve a vehicle. + + Experimental: This field's behavior or existence + may change in future. + + This field is a member of `oneof`_ ``_estimated_incompatible_vehicle_ratio``. reasons (MutableSequence[google.maps.routeoptimization_v1.types.SkippedShipment.Reason]): A list of reasons that explain why the shipment was skipped. See comment above ``Reason``. If we are unable to understand @@ -3197,6 +3674,16 @@ class Reason(proto.Message): provides the index of one relevant vehicle. This field is a member of `oneof`_ ``_example_vehicle_index``. + example_vehicle_indices (MutableSequence[int]): + Same as + [example_vehicle_index][google.maps.routeoptimization.v1.SkippedShipment.Reason.example_vehicle_index] + except that we provide the list of multiple identified + vehicles. This list is not necessarily exhaustive. This is + only filled if + [fill_example_vehicle_indices_in_skipped_reasons][] is true. + + Experimental: This field's behavior or existence may change + in future. example_exceeded_capacity_type (str): If the reason code is ``DEMAND_EXCEEDS_VEHICLE_CAPACITY``, documents one capacity type that is exceeded. @@ -3246,6 +3733,37 @@ class Code(proto.Enum): VEHICLE_NOT_ALLOWED (7): The ``allowed_vehicle_indices`` field of the shipment is not empty and this vehicle does not belong to it. + VEHICLE_IGNORED (8): + The vehicle's ``ignore`` field is true. + + Experimental: This field's behavior or existence may change + in future. + SHIPMENT_IGNORED (9): + The shipment's ``ignore`` field is true. + + Experimental: This field's behavior or existence may change + in future. + SKIPPED_IN_INJECTED_SOLUTION_CONSTRAINT (10): + The shipment is skipped in the + ``injected_solution_constraint``. + + Experimental: This field's behavior or existence may change + in future. + VEHICLE_ROUTE_IS_FULLY_SEQUENCE_CONSTRAINED (11): + The vehicle route relaxation specified in the + ``injected_solution_constraint`` doesn't permit any visit to + be inserted. + + Experimental: This field's behavior or existence may change + in future. + ZERO_PENALTY_COST (13): + The shipment has a zero penalty cost. While + this can be useful as an advanced modelling + choice, it may also explain after the fact why a + shipment was skipped. + + Experimental: This field's behavior or existence + may change in future. """ CODE_UNSPECIFIED = 0 NO_VEHICLE = 1 @@ -3255,6 +3773,11 @@ class Code(proto.Enum): CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5 CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6 VEHICLE_NOT_ALLOWED = 7 + VEHICLE_IGNORED = 8 + SHIPMENT_IGNORED = 9 + SKIPPED_IN_INJECTED_SOLUTION_CONSTRAINT = 10 + VEHICLE_ROUTE_IS_FULLY_SEQUENCE_CONSTRAINED = 11 + ZERO_PENALTY_COST = 13 code: "SkippedShipment.Reason.Code" = proto.Field( proto.ENUM, @@ -3266,6 +3789,10 @@ class Code(proto.Enum): number=2, optional=True, ) + example_vehicle_indices: MutableSequence[int] = proto.RepeatedField( + proto.INT32, + number=5, + ) example_exceeded_capacity_type: str = proto.Field( proto.STRING, number=3, @@ -3279,6 +3806,16 @@ class Code(proto.Enum): proto.STRING, number=2, ) + penalty_cost: float = proto.Field( + proto.DOUBLE, + number=6, + optional=True, + ) + estimated_incompatible_vehicle_ratio: float = proto.Field( + proto.DOUBLE, + number=5, + optional=True, + ) reasons: MutableSequence[Reason] = proto.RepeatedField( proto.MESSAGE, number=3, @@ -3298,10 +3835,29 @@ class AggregatedMetrics(proto.Message): [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute]) elements. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: performed_shipment_count (int): Number of shipments performed. Note that a pickup and delivery pair only counts once. + performed_mandatory_shipment_count (int): + Number of mandatory shipments performed. + + Experimental: This field's behavior or existence + may change in future. + + This field is a member of `oneof`_ ``_performed_mandatory_shipment_count``. + performed_shipment_penalty_cost_sum (float): + The sum of the + [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost] + of the performed shipments. + + Experimental: This field's behavior or existence may change + in future. + + This field is a member of `oneof`_ ``_performed_shipment_penalty_cost_sum``. travel_duration (google.protobuf.duration_pb2.Duration): Total travel duration for a route or a solution. @@ -3342,6 +3898,16 @@ class AggregatedMetrics(proto.Message): proto.INT32, number=1, ) + performed_mandatory_shipment_count: int = proto.Field( + proto.INT32, + number=12, + optional=True, + ) + performed_shipment_penalty_cost_sum: float = proto.Field( + proto.DOUBLE, + number=13, + optional=True, + ) travel_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=2, @@ -3384,6 +3950,107 @@ class AggregatedMetrics(proto.Message): ) +class VehicleFullness(proto.Message): + r"""[VehicleFullness][google.maps.routeoptimization.v1.VehicleFullness] + is a metric which computes how full a vehicle is. Each + [VehicleFullness][google.maps.routeoptimization.v1.VehicleFullness] + field is between 0 and 1, computed as the ratio between a capped + metric field (e.g. + [AggregatedMetrics.travel_distance_meters][google.maps.routeoptimization.v1.AggregatedMetrics.travel_distance_meters]) + and its related vehicle limit (e.g. + [Vehicle.route_distance_limit][google.maps.routeoptimization.v1.Vehicle.route_distance_limit]), + if it exists. Otherwise the fullness ratio stays unset. If the limit + is 0, the field is set to 1. Note: when a route is subject to + traffic infeasibilities, some raw fullness ratios might exceed 1.0, + e.g. the vehicle might exceed its distance limit. In these cases, we + cap the fullness values at 1.0. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + max_fullness (float): + Maximum of all other fields in this message. + + This field is a member of `oneof`_ ``_max_fullness``. + distance (float): + The ratio between + [AggregatedMetrics.travel_distance_meters][google.maps.routeoptimization.v1.AggregatedMetrics.travel_distance_meters] + and + [Vehicle.route_distance_limit][google.maps.routeoptimization.v1.Vehicle.route_distance_limit]. + If + [Vehicle.route_distance_limit][google.maps.routeoptimization.v1.Vehicle.route_distance_limit] + is unset, this field will be unset. + + This field is a member of `oneof`_ ``_distance``. + travel_duration (float): + The ratio between + [AggregatedMetrics.travel_duration_seconds][] and + [Vehicle.travel_duration_limit][google.maps.routeoptimization.v1.Vehicle.travel_duration_limit]. + If + [Vehicle.travel_duration_limit][google.maps.routeoptimization.v1.Vehicle.travel_duration_limit] + is unset, this field will be unset. + + This field is a member of `oneof`_ ``_travel_duration``. + active_duration (float): + The ratio between + [AggregatedMetrics.total_duration_seconds][] and + [Vehicle.route_duration_limit][google.maps.routeoptimization.v1.Vehicle.route_duration_limit]. + If + [Vehicle.route_duration_limit][google.maps.routeoptimization.v1.Vehicle.route_duration_limit] + is unset, this field will be unset. + + This field is a member of `oneof`_ ``_active_duration``. + max_load (float): + The maximum ratio among all types of + [AggregatedMetrics.max_load][] and their respective + [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits]. + If all + [Vehicle.load_limits][google.maps.routeoptimization.v1.Vehicle.load_limits] + fields are unset, this field will be unset. + + This field is a member of `oneof`_ ``_max_load``. + active_span (float): + The ratio (vehicle_end_time - vehicle_start_time) / (latest_vehicle_end_time - earliest_vehicle_start_time) for a given vehicle. If the denominator is not present, it uses + ([ShipmentModel.global_end_time][google.maps.routeoptimization.v1.ShipmentModel.global_end_time] - + [ShipmentModel.global_start_time][google.maps.routeoptimization.v1.ShipmentModel.global_start_time]) + instead. + + This field is a member of `oneof`_ ``_active_span``. + """ + + max_fullness: float = proto.Field( + proto.DOUBLE, + number=1, + optional=True, + ) + distance: float = proto.Field( + proto.DOUBLE, + number=2, + optional=True, + ) + travel_duration: float = proto.Field( + proto.DOUBLE, + number=3, + optional=True, + ) + active_duration: float = proto.Field( + proto.DOUBLE, + number=4, + optional=True, + ) + max_load: float = proto.Field( + proto.DOUBLE, + number=5, + optional=True, + ) + active_span: float = proto.Field( + proto.DOUBLE, + number=6, + optional=True, + ) + + class InjectedSolutionConstraint(proto.Message): r"""Solution injected in the request including information about which visits must be constrained and how they must be diff --git a/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_long_running_async.py b/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_long_running_async.py new file mode 100644 index 000000000000..6b19983155a1 --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_long_running_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for OptimizeToursLongRunning +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-maps-routeoptimization + + +# [START routeoptimization_v1_generated_RouteOptimization_OptimizeToursLongRunning_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.maps import routeoptimization_v1 + + +async def sample_optimize_tours_long_running(): + # Create a client + client = routeoptimization_v1.RouteOptimizationAsyncClient() + + # Initialize request argument(s) + request = routeoptimization_v1.OptimizeToursRequest( + parent="parent_value", + ) + + # Make the request + operation = client.optimize_tours_long_running(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END routeoptimization_v1_generated_RouteOptimization_OptimizeToursLongRunning_async] diff --git a/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_long_running_sync.py b/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_long_running_sync.py new file mode 100644 index 000000000000..9c6ad4e6a318 --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_long_running_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for OptimizeToursLongRunning +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-maps-routeoptimization + + +# [START routeoptimization_v1_generated_RouteOptimization_OptimizeToursLongRunning_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.maps import routeoptimization_v1 + + +def sample_optimize_tours_long_running(): + # Create a client + client = routeoptimization_v1.RouteOptimizationClient() + + # Initialize request argument(s) + request = routeoptimization_v1.OptimizeToursRequest( + parent="parent_value", + ) + + # Make the request + operation = client.optimize_tours_long_running(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END routeoptimization_v1_generated_RouteOptimization_OptimizeToursLongRunning_sync] diff --git a/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_uri_async.py b/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_uri_async.py new file mode 100644 index 000000000000..d4f44c249a0e --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_uri_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for OptimizeToursUri +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-maps-routeoptimization + + +# [START routeoptimization_v1_generated_RouteOptimization_OptimizeToursUri_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.maps import routeoptimization_v1 + + +async def sample_optimize_tours_uri(): + # Create a client + client = routeoptimization_v1.RouteOptimizationAsyncClient() + + # Initialize request argument(s) + request = routeoptimization_v1.OptimizeToursUriRequest( + parent="parent_value", + ) + + # Make the request + operation = client.optimize_tours_uri(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END routeoptimization_v1_generated_RouteOptimization_OptimizeToursUri_async] diff --git a/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_uri_sync.py b/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_uri_sync.py new file mode 100644 index 000000000000..82155d639100 --- /dev/null +++ b/packages/google-maps-routeoptimization/samples/generated_samples/routeoptimization_v1_generated_route_optimization_optimize_tours_uri_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for OptimizeToursUri +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-maps-routeoptimization + + +# [START routeoptimization_v1_generated_RouteOptimization_OptimizeToursUri_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.maps import routeoptimization_v1 + + +def sample_optimize_tours_uri(): + # Create a client + client = routeoptimization_v1.RouteOptimizationClient() + + # Initialize request argument(s) + request = routeoptimization_v1.OptimizeToursUriRequest( + parent="parent_value", + ) + + # Make the request + operation = client.optimize_tours_uri(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END routeoptimization_v1_generated_RouteOptimization_OptimizeToursUri_sync] diff --git a/packages/google-maps-routeoptimization/samples/generated_samples/snippet_metadata_google.maps.routeoptimization.v1.json b/packages/google-maps-routeoptimization/samples/generated_samples/snippet_metadata_google.maps.routeoptimization.v1.json index e39580e0e794..095dc6675622 100644 --- a/packages/google-maps-routeoptimization/samples/generated_samples/snippet_metadata_google.maps.routeoptimization.v1.json +++ b/packages/google-maps-routeoptimization/samples/generated_samples/snippet_metadata_google.maps.routeoptimization.v1.json @@ -164,6 +164,312 @@ ], "title": "routeoptimization_v1_generated_route_optimization_batch_optimize_tours_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.maps.routeoptimization_v1.RouteOptimizationAsyncClient", + "shortName": "RouteOptimizationAsyncClient" + }, + "fullName": "google.maps.routeoptimization_v1.RouteOptimizationAsyncClient.optimize_tours_long_running", + "method": { + "fullName": "google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursLongRunning", + "service": { + "fullName": "google.maps.routeoptimization.v1.RouteOptimization", + "shortName": "RouteOptimization" + }, + "shortName": "OptimizeToursLongRunning" + }, + "parameters": [ + { + "name": "request", + "type": "google.maps.routeoptimization_v1.types.OptimizeToursRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "optimize_tours_long_running" + }, + "description": "Sample for OptimizeToursLongRunning", + "file": "routeoptimization_v1_generated_route_optimization_optimize_tours_long_running_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "routeoptimization_v1_generated_RouteOptimization_OptimizeToursLongRunning_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "routeoptimization_v1_generated_route_optimization_optimize_tours_long_running_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.maps.routeoptimization_v1.RouteOptimizationClient", + "shortName": "RouteOptimizationClient" + }, + "fullName": "google.maps.routeoptimization_v1.RouteOptimizationClient.optimize_tours_long_running", + "method": { + "fullName": "google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursLongRunning", + "service": { + "fullName": "google.maps.routeoptimization.v1.RouteOptimization", + "shortName": "RouteOptimization" + }, + "shortName": "OptimizeToursLongRunning" + }, + "parameters": [ + { + "name": "request", + "type": "google.maps.routeoptimization_v1.types.OptimizeToursRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "optimize_tours_long_running" + }, + "description": "Sample for OptimizeToursLongRunning", + "file": "routeoptimization_v1_generated_route_optimization_optimize_tours_long_running_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "routeoptimization_v1_generated_RouteOptimization_OptimizeToursLongRunning_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "routeoptimization_v1_generated_route_optimization_optimize_tours_long_running_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.maps.routeoptimization_v1.RouteOptimizationAsyncClient", + "shortName": "RouteOptimizationAsyncClient" + }, + "fullName": "google.maps.routeoptimization_v1.RouteOptimizationAsyncClient.optimize_tours_uri", + "method": { + "fullName": "google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursUri", + "service": { + "fullName": "google.maps.routeoptimization.v1.RouteOptimization", + "shortName": "RouteOptimization" + }, + "shortName": "OptimizeToursUri" + }, + "parameters": [ + { + "name": "request", + "type": "google.maps.routeoptimization_v1.types.OptimizeToursUriRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "optimize_tours_uri" + }, + "description": "Sample for OptimizeToursUri", + "file": "routeoptimization_v1_generated_route_optimization_optimize_tours_uri_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "routeoptimization_v1_generated_RouteOptimization_OptimizeToursUri_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "routeoptimization_v1_generated_route_optimization_optimize_tours_uri_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.maps.routeoptimization_v1.RouteOptimizationClient", + "shortName": "RouteOptimizationClient" + }, + "fullName": "google.maps.routeoptimization_v1.RouteOptimizationClient.optimize_tours_uri", + "method": { + "fullName": "google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursUri", + "service": { + "fullName": "google.maps.routeoptimization.v1.RouteOptimization", + "shortName": "RouteOptimization" + }, + "shortName": "OptimizeToursUri" + }, + "parameters": [ + { + "name": "request", + "type": "google.maps.routeoptimization_v1.types.OptimizeToursUriRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "optimize_tours_uri" + }, + "description": "Sample for OptimizeToursUri", + "file": "routeoptimization_v1_generated_route_optimization_optimize_tours_uri_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "routeoptimization_v1_generated_RouteOptimization_OptimizeToursUri_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "routeoptimization_v1_generated_route_optimization_optimize_tours_uri_sync.py" + }, { "canonical": true, "clientMethod": { diff --git a/packages/google-maps-routeoptimization/scripts/fixup_routeoptimization_v1_keywords.py b/packages/google-maps-routeoptimization/scripts/fixup_routeoptimization_v1_keywords.py index c95e68d8d811..bfc511ce18f3 100644 --- a/packages/google-maps-routeoptimization/scripts/fixup_routeoptimization_v1_keywords.py +++ b/packages/google-maps-routeoptimization/scripts/fixup_routeoptimization_v1_keywords.py @@ -41,6 +41,8 @@ class routeoptimizationCallTransformer(cst.CSTTransformer): METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { 'batch_optimize_tours': ('parent', 'model_configs', ), 'optimize_tours': ('parent', 'timeout', 'model', 'solving_mode', 'search_mode', 'injected_first_solution_routes', 'injected_solution_constraint', 'refresh_details_routes', 'interpret_injected_solutions_using_labels', 'consider_road_traffic', 'populate_polylines', 'populate_transition_polylines', 'allow_large_deadline_despite_interruption_risk', 'use_geodesic_distances', 'geodesic_meters_per_second', 'max_validation_errors', 'label', ), + 'optimize_tours_long_running': ('parent', 'timeout', 'model', 'solving_mode', 'search_mode', 'injected_first_solution_routes', 'injected_solution_constraint', 'refresh_details_routes', 'interpret_injected_solutions_using_labels', 'consider_road_traffic', 'populate_polylines', 'populate_transition_polylines', 'allow_large_deadline_despite_interruption_risk', 'use_geodesic_distances', 'geodesic_meters_per_second', 'max_validation_errors', 'label', ), + 'optimize_tours_uri': ('parent', 'input', 'output', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: diff --git a/packages/google-maps-routeoptimization/tests/unit/gapic/routeoptimization_v1/test_route_optimization.py b/packages/google-maps-routeoptimization/tests/unit/gapic/routeoptimization_v1/test_route_optimization.py index 090a697cf7ea..72abc9707393 100644 --- a/packages/google-maps-routeoptimization/tests/unit/gapic/routeoptimization_v1/test_route_optimization.py +++ b/packages/google-maps-routeoptimization/tests/unit/gapic/routeoptimization_v1/test_route_optimization.py @@ -1664,13 +1664,80 @@ async def test_batch_optimize_tours_field_headers_async(): ) in kw["metadata"] -def test_optimize_tours_rest_use_cached_wrapped_rpc(): +@pytest.mark.parametrize( + "request_type", + [ + route_optimization_service.OptimizeToursRequest, + dict, + ], +) +def test_optimize_tours_long_running(request_type, transport: str = "grpc"): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_long_running), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.optimize_tours_long_running(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = route_optimization_service.OptimizeToursRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_optimize_tours_long_running_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = route_optimization_service.OptimizeToursRequest( + parent="parent_value", + label="label_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_long_running), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.optimize_tours_long_running(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == route_optimization_service.OptimizeToursRequest( + parent="parent_value", + label="label_value", + ) + + +def test_optimize_tours_long_running_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: client = RouteOptimizationClient( credentials=ga_credentials.AnonymousCredentials(), - transport="rest", + transport="grpc", ) # Should wrap all calls on client creation @@ -1678,122 +1745,47 @@ def test_optimize_tours_rest_use_cached_wrapped_rpc(): wrapper_fn.reset_mock() # Ensure method has been cached - assert client._transport.optimize_tours in client._transport._wrapped_methods + assert ( + client._transport.optimize_tours_long_running + in client._transport._wrapped_methods + ) # Replace cached wrapped function with mock mock_rpc = mock.Mock() mock_rpc.return_value.name = ( "foo" # operation_request.operation in compute client(s) expect a string. ) - client._transport._wrapped_methods[client._transport.optimize_tours] = mock_rpc - + client._transport._wrapped_methods[ + client._transport.optimize_tours_long_running + ] = mock_rpc request = {} - client.optimize_tours(request) + client.optimize_tours_long_running(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.optimize_tours(request) + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.optimize_tours_long_running(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -def test_optimize_tours_rest_required_fields( - request_type=route_optimization_service.OptimizeToursRequest, +@pytest.mark.asyncio +async def test_optimize_tours_long_running_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", ): - transport_class = transports.RouteOptimizationRestTransport - - request_init = {} - request_init["parent"] = "" - request = request_type(**request_init) - pb_request = request_type.pb(request) - jsonified_request = json.loads( - json_format.MessageToJson(pb_request, use_integers_for_enums=False) - ) - - # verify fields with default values are dropped - - unset_fields = transport_class( - credentials=ga_credentials.AnonymousCredentials() - ).optimize_tours._get_unset_required_fields(jsonified_request) - jsonified_request.update(unset_fields) - - # verify required fields with default values are now present - - jsonified_request["parent"] = "parent_value" - - unset_fields = transport_class( - credentials=ga_credentials.AnonymousCredentials() - ).optimize_tours._get_unset_required_fields(jsonified_request) - jsonified_request.update(unset_fields) - - # verify required fields with non-default values are left alone - assert "parent" in jsonified_request - assert jsonified_request["parent"] == "parent_value" - - client = RouteOptimizationClient( - credentials=ga_credentials.AnonymousCredentials(), - transport="rest", - ) - request = request_type(**request_init) - - # Designate an appropriate value for the returned response. - return_value = route_optimization_service.OptimizeToursResponse() - # Mock the http request call within the method and fake a response. - with mock.patch.object(Session, "request") as req: - # We need to mock transcode() because providing default values - # for required fields will fail the real version if the http_options - # expect actual values for those fields. - with mock.patch.object(path_template, "transcode") as transcode: - # A uri without fields and an empty body will force all the - # request fields to show up in the query_params. - pb_request = request_type.pb(request) - transcode_result = { - "uri": "v1/sample_method", - "method": "post", - "query_params": pb_request, - } - transcode_result["body"] = pb_request - transcode.return_value = transcode_result - - response_value = Response() - response_value.status_code = 200 - - # Convert return value to protobuf type - return_value = route_optimization_service.OptimizeToursResponse.pb( - return_value - ) - json_return_value = json_format.MessageToJson(return_value) - - response_value._content = json_return_value.encode("UTF-8") - req.return_value = response_value - req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - - response = client.optimize_tours(request) - - expected_params = [("$alt", "json;enum-encoding=int")] - actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params - - -def test_optimize_tours_rest_unset_required_fields(): - transport = transports.RouteOptimizationRestTransport( - credentials=ga_credentials.AnonymousCredentials - ) - - unset_fields = transport.optimize_tours._get_unset_required_fields({}) - assert set(unset_fields) == (set(()) & set(("parent",))) - - -def test_batch_optimize_tours_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call - with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = RouteOptimizationClient( - credentials=ga_credentials.AnonymousCredentials(), - transport="rest", + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, ) # Should wrap all calls on client creation @@ -1802,86 +1794,752 @@ def test_batch_optimize_tours_rest_use_cached_wrapped_rpc(): # Ensure method has been cached assert ( - client._transport.batch_optimize_tours in client._transport._wrapped_methods + client._client._transport.optimize_tours_long_running + in client._client._transport._wrapped_methods ) # Replace cached wrapped function with mock - mock_rpc = mock.Mock() - mock_rpc.return_value.name = ( - "foo" # operation_request.operation in compute client(s) expect a string. - ) - client._transport._wrapped_methods[ - client._transport.batch_optimize_tours + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.optimize_tours_long_running ] = mock_rpc request = {} - client.batch_optimize_tours(request) + await client.optimize_tours_long_running(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - # Operation methods build a cached wrapper on first rpc call - # subsequent calls should use the cached wrapper + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper wrapper_fn.reset_mock() - client.batch_optimize_tours(request) + await client.optimize_tours_long_running(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -def test_batch_optimize_tours_rest_required_fields( - request_type=route_optimization_service.BatchOptimizeToursRequest, +@pytest.mark.asyncio +async def test_optimize_tours_long_running_async( + transport: str = "grpc_asyncio", + request_type=route_optimization_service.OptimizeToursRequest, ): - transport_class = transports.RouteOptimizationRestTransport - - request_init = {} - request_init["parent"] = "" - request = request_type(**request_init) - pb_request = request_type.pb(request) - jsonified_request = json.loads( - json_format.MessageToJson(pb_request, use_integers_for_enums=False) + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, ) - # verify fields with default values are dropped + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() - unset_fields = transport_class( - credentials=ga_credentials.AnonymousCredentials() - ).batch_optimize_tours._get_unset_required_fields(jsonified_request) - jsonified_request.update(unset_fields) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_long_running), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.optimize_tours_long_running(request) - # verify required fields with default values are now present + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = route_optimization_service.OptimizeToursRequest() + assert args[0] == request - jsonified_request["parent"] = "parent_value" + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) - unset_fields = transport_class( - credentials=ga_credentials.AnonymousCredentials() - ).batch_optimize_tours._get_unset_required_fields(jsonified_request) - jsonified_request.update(unset_fields) - # verify required fields with non-default values are left alone - assert "parent" in jsonified_request - assert jsonified_request["parent"] == "parent_value" +@pytest.mark.asyncio +async def test_optimize_tours_long_running_async_from_dict(): + await test_optimize_tours_long_running_async(request_type=dict) + +def test_optimize_tours_long_running_field_headers(): client = RouteOptimizationClient( credentials=ga_credentials.AnonymousCredentials(), - transport="rest", ) - request = request_type(**request_init) - # Designate an appropriate value for the returned response. - return_value = operations_pb2.Operation(name="operations/spam") - # Mock the http request call within the method and fake a response. - with mock.patch.object(Session, "request") as req: - # We need to mock transcode() because providing default values - # for required fields will fail the real version if the http_options - # expect actual values for those fields. - with mock.patch.object(path_template, "transcode") as transcode: - # A uri without fields and an empty body will force all the - # request fields to show up in the query_params. - pb_request = request_type.pb(request) - transcode_result = { + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = route_optimization_service.OptimizeToursRequest() + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_long_running), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.optimize_tours_long_running(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "parent=parent_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_optimize_tours_long_running_field_headers_async(): + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = route_optimization_service.OptimizeToursRequest() + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_long_running), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.optimize_tours_long_running(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "parent=parent_value", + ) in kw["metadata"] + + +@pytest.mark.parametrize( + "request_type", + [ + route_optimization_service.OptimizeToursUriRequest, + dict, + ], +) +def test_optimize_tours_uri(request_type, transport: str = "grpc"): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_uri), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.optimize_tours_uri(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = route_optimization_service.OptimizeToursUriRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_optimize_tours_uri_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = route_optimization_service.OptimizeToursUriRequest( + parent="parent_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_uri), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.optimize_tours_uri(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == route_optimization_service.OptimizeToursUriRequest( + parent="parent_value", + ) + + +def test_optimize_tours_uri_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.optimize_tours_uri in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.optimize_tours_uri + ] = mock_rpc + request = {} + client.optimize_tours_uri(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.optimize_tours_uri(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_optimize_tours_uri_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.optimize_tours_uri + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.optimize_tours_uri + ] = mock_rpc + + request = {} + await client.optimize_tours_uri(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + await client.optimize_tours_uri(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_optimize_tours_uri_async( + transport: str = "grpc_asyncio", + request_type=route_optimization_service.OptimizeToursUriRequest, +): + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_uri), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.optimize_tours_uri(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = route_optimization_service.OptimizeToursUriRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_optimize_tours_uri_async_from_dict(): + await test_optimize_tours_uri_async(request_type=dict) + + +def test_optimize_tours_uri_field_headers(): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = route_optimization_service.OptimizeToursUriRequest() + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_uri), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.optimize_tours_uri(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "parent=parent_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_optimize_tours_uri_field_headers_async(): + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = route_optimization_service.OptimizeToursUriRequest() + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_uri), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.optimize_tours_uri(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "parent=parent_value", + ) in kw["metadata"] + + +def test_optimize_tours_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.optimize_tours in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.optimize_tours] = mock_rpc + + request = {} + client.optimize_tours(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.optimize_tours(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_optimize_tours_rest_required_fields( + request_type=route_optimization_service.OptimizeToursRequest, +): + transport_class = transports.RouteOptimizationRestTransport + + request_init = {} + request_init["parent"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).optimize_tours._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["parent"] = "parent_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).optimize_tours._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "parent" in jsonified_request + assert jsonified_request["parent"] == "parent_value" + + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = route_optimization_service.OptimizeToursResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = route_optimization_service.OptimizeToursResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.optimize_tours(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_optimize_tours_rest_unset_required_fields(): + transport = transports.RouteOptimizationRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.optimize_tours._get_unset_required_fields({}) + assert set(unset_fields) == (set(()) & set(("parent",))) + + +def test_batch_optimize_tours_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.batch_optimize_tours in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.batch_optimize_tours + ] = mock_rpc + + request = {} + client.batch_optimize_tours(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.batch_optimize_tours(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_batch_optimize_tours_rest_required_fields( + request_type=route_optimization_service.BatchOptimizeToursRequest, +): + transport_class = transports.RouteOptimizationRestTransport + + request_init = {} + request_init["parent"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).batch_optimize_tours._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["parent"] = "parent_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).batch_optimize_tours._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "parent" in jsonified_request + assert jsonified_request["parent"] == "parent_value" + + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.batch_optimize_tours(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_batch_optimize_tours_rest_unset_required_fields(): + transport = transports.RouteOptimizationRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.batch_optimize_tours._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "parent", + "modelConfigs", + ) + ) + ) + + +def test_optimize_tours_long_running_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.optimize_tours_long_running + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.optimize_tours_long_running + ] = mock_rpc + + request = {} + client.optimize_tours_long_running(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.optimize_tours_long_running(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_optimize_tours_long_running_rest_required_fields( + request_type=route_optimization_service.OptimizeToursRequest, +): + transport_class = transports.RouteOptimizationRestTransport + + request_init = {} + request_init["parent"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).optimize_tours_long_running._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["parent"] = "parent_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).optimize_tours_long_running._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "parent" in jsonified_request + assert jsonified_request["parent"] == "parent_value" + + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { "uri": "v1/sample_method", "method": "post", "query_params": pb_request, @@ -1897,25 +2555,152 @@ def test_batch_optimize_tours_rest_required_fields( req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.batch_optimize_tours(request) + response = client.optimize_tours_long_running(request) expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_batch_optimize_tours_rest_unset_required_fields(): +def test_optimize_tours_long_running_rest_unset_required_fields(): transport = transports.RouteOptimizationRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.batch_optimize_tours._get_unset_required_fields({}) + unset_fields = transport.optimize_tours_long_running._get_unset_required_fields({}) + assert set(unset_fields) == (set(()) & set(("parent",))) + + +def test_optimize_tours_uri_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.optimize_tours_uri in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.optimize_tours_uri + ] = mock_rpc + + request = {} + client.optimize_tours_uri(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.optimize_tours_uri(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_optimize_tours_uri_rest_required_fields( + request_type=route_optimization_service.OptimizeToursUriRequest, +): + transport_class = transports.RouteOptimizationRestTransport + + request_init = {} + request_init["parent"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).optimize_tours_uri._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["parent"] = "parent_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).optimize_tours_uri._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "parent" in jsonified_request + assert jsonified_request["parent"] == "parent_value" + + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.optimize_tours_uri(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_optimize_tours_uri_rest_unset_required_fields(): + transport = transports.RouteOptimizationRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.optimize_tours_uri._get_unset_required_fields({}) assert set(unset_fields) == ( set(()) & set( ( "parent", - "modelConfigs", + "input", + "output", ) ) ) @@ -1990,55 +2775,165 @@ def test_transport_get_channel(): channel = transport.grpc_channel assert channel - transport = transports.RouteOptimizationGrpcAsyncIOTransport( + transport = transports.RouteOptimizationGrpcAsyncIOTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.RouteOptimizationGrpcTransport, + transports.RouteOptimizationGrpcAsyncIOTransport, + transports.RouteOptimizationRestTransport, + ], +) +def test_transport_adc(transport_class): + # Test default credentials are used if not provided. + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class() + adc.assert_called_once() + + +def test_transport_kind_grpc(): + transport = RouteOptimizationClient.get_transport_class("grpc")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "grpc" + + +def test_initialize_client_w_grpc(): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc" + ) + assert client is not None + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_optimize_tours_empty_call_grpc(): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.optimize_tours), "__call__") as call: + call.return_value = route_optimization_service.OptimizeToursResponse() + client.optimize_tours(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = route_optimization_service.OptimizeToursRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_batch_optimize_tours_empty_call_grpc(): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.batch_optimize_tours), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.batch_optimize_tours(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = route_optimization_service.BatchOptimizeToursRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_optimize_tours_long_running_empty_call_grpc(): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_long_running), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.optimize_tours_long_running(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = route_optimization_service.OptimizeToursRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_optimize_tours_uri_empty_call_grpc(): + client = RouteOptimizationClient( credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) - channel = transport.grpc_channel - assert channel + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_uri), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.optimize_tours_uri(request=None) -@pytest.mark.parametrize( - "transport_class", - [ - transports.RouteOptimizationGrpcTransport, - transports.RouteOptimizationGrpcAsyncIOTransport, - transports.RouteOptimizationRestTransport, - ], -) -def test_transport_adc(transport_class): - # Test default credentials are used if not provided. - with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (ga_credentials.AnonymousCredentials(), None) - transport_class() - adc.assert_called_once() + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = route_optimization_service.OptimizeToursUriRequest() + assert args[0] == request_msg -def test_transport_kind_grpc(): - transport = RouteOptimizationClient.get_transport_class("grpc")( - credentials=ga_credentials.AnonymousCredentials() + +def test_transport_kind_grpc_asyncio(): + transport = RouteOptimizationAsyncClient.get_transport_class("grpc_asyncio")( + credentials=async_anonymous_credentials() ) - assert transport.kind == "grpc" + assert transport.kind == "grpc_asyncio" -def test_initialize_client_w_grpc(): - client = RouteOptimizationClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc" +def test_initialize_client_w_grpc_asyncio(): + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), transport="grpc_asyncio" ) assert client is not None # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_optimize_tours_empty_call_grpc(): - client = RouteOptimizationClient( - credentials=ga_credentials.AnonymousCredentials(), - transport="grpc", +@pytest.mark.asyncio +async def test_optimize_tours_empty_call_grpc_asyncio(): + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", ) # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.optimize_tours), "__call__") as call: - call.return_value = route_optimization_service.OptimizeToursResponse() - client.optimize_tours(request=None) + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + route_optimization_service.OptimizeToursResponse( + request_label="request_label_value", + ) + ) + await client.optimize_tours(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -2050,18 +2945,22 @@ def test_optimize_tours_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_batch_optimize_tours_empty_call_grpc(): - client = RouteOptimizationClient( - credentials=ga_credentials.AnonymousCredentials(), - transport="grpc", +@pytest.mark.asyncio +async def test_batch_optimize_tours_empty_call_grpc_asyncio(): + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", ) # Mock the actual call, and fake the request. with mock.patch.object( type(client.transport.batch_optimize_tours), "__call__" ) as call: - call.return_value = operations_pb2.Operation(name="operations/op") - client.batch_optimize_tours(request=None) + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + await client.batch_optimize_tours(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -2071,82 +2970,324 @@ def test_batch_optimize_tours_empty_call_grpc(): assert args[0] == request_msg -def test_transport_kind_grpc_asyncio(): - transport = RouteOptimizationAsyncClient.get_transport_class("grpc_asyncio")( - credentials=async_anonymous_credentials() - ) - assert transport.kind == "grpc_asyncio" +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_optimize_tours_long_running_empty_call_grpc_asyncio(): + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_long_running), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + await client.optimize_tours_long_running(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = route_optimization_service.OptimizeToursRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_optimize_tours_uri_empty_call_grpc_asyncio(): + client = RouteOptimizationAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_uri), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + await client.optimize_tours_uri(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = route_optimization_service.OptimizeToursUriRequest() + + assert args[0] == request_msg + + +def test_transport_kind_rest(): + transport = RouteOptimizationClient.get_transport_class("rest")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "rest" + + +def test_optimize_tours_rest_bad_request( + request_type=route_optimization_service.OptimizeToursRequest, +): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.optimize_tours(request) + + +@pytest.mark.parametrize( + "request_type", + [ + route_optimization_service.OptimizeToursRequest, + dict, + ], +) +def test_optimize_tours_rest_call_success(request_type): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = route_optimization_service.OptimizeToursResponse( + request_label="request_label_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = route_optimization_service.OptimizeToursResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.optimize_tours(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, route_optimization_service.OptimizeToursResponse) + assert response.request_label == "request_label_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_optimize_tours_rest_interceptors(null_interceptor): + transport = transports.RouteOptimizationRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RouteOptimizationRestInterceptor(), + ) + client = RouteOptimizationClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.RouteOptimizationRestInterceptor, "post_optimize_tours" + ) as post, mock.patch.object( + transports.RouteOptimizationRestInterceptor, "post_optimize_tours_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.RouteOptimizationRestInterceptor, "pre_optimize_tours" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = route_optimization_service.OptimizeToursRequest.pb( + route_optimization_service.OptimizeToursRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = route_optimization_service.OptimizeToursResponse.to_json( + route_optimization_service.OptimizeToursResponse() + ) + req.return_value.content = return_value + + request = route_optimization_service.OptimizeToursRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = route_optimization_service.OptimizeToursResponse() + post_with_metadata.return_value = ( + route_optimization_service.OptimizeToursResponse(), + metadata, + ) + + client.optimize_tours( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() -def test_initialize_client_w_grpc_asyncio(): - client = RouteOptimizationAsyncClient( - credentials=async_anonymous_credentials(), transport="grpc_asyncio" +def test_batch_optimize_tours_rest_bad_request( + request_type=route_optimization_service.BatchOptimizeToursRequest, +): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) - assert client is not None + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.batch_optimize_tours(request) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_optimize_tours_empty_call_grpc_asyncio(): - client = RouteOptimizationAsyncClient( - credentials=async_anonymous_credentials(), - transport="grpc_asyncio", +@pytest.mark.parametrize( + "request_type", + [ + route_optimization_service.BatchOptimizeToursRequest, + dict, + ], +) +def test_batch_optimize_tours_rest_call_success(request_type): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) - # Mock the actual call, and fake the request. - with mock.patch.object(type(client.transport.optimize_tours), "__call__") as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - route_optimization_service.OptimizeToursResponse( - request_label="request_label_value", - ) - ) - await client.optimize_tours(request=None) + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request = request_type(**request_init) - # Establish that the underlying stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - request_msg = route_optimization_service.OptimizeToursRequest() + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") - assert args[0] == request_msg + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.batch_optimize_tours(request) + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) -# This test is a coverage failsafe to make sure that totally empty calls, -# i.e. request == None and no flattened fields passed, work. -@pytest.mark.asyncio -async def test_batch_optimize_tours_empty_call_grpc_asyncio(): - client = RouteOptimizationAsyncClient( - credentials=async_anonymous_credentials(), - transport="grpc_asyncio", + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_batch_optimize_tours_rest_interceptors(null_interceptor): + transport = transports.RouteOptimizationRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RouteOptimizationRestInterceptor(), ) + client = RouteOptimizationClient(transport=transport) - # Mock the actual call, and fake the request. with mock.patch.object( - type(client.transport.batch_optimize_tours), "__call__" - ) as call: - # Designate an appropriate return value for the call. - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - operations_pb2.Operation(name="operations/spam") + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.RouteOptimizationRestInterceptor, "post_batch_optimize_tours" + ) as post, mock.patch.object( + transports.RouteOptimizationRestInterceptor, + "post_batch_optimize_tours_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.RouteOptimizationRestInterceptor, "pre_batch_optimize_tours" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = route_optimization_service.BatchOptimizeToursRequest.pb( + route_optimization_service.BatchOptimizeToursRequest() ) - await client.batch_optimize_tours(request=None) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } - # Establish that the underlying stub method was called. - call.assert_called() - _, args, _ = call.mock_calls[0] - request_msg = route_optimization_service.BatchOptimizeToursRequest() + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.content = return_value - assert args[0] == request_msg + request = route_optimization_service.BatchOptimizeToursRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + client.batch_optimize_tours( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) -def test_transport_kind_rest(): - transport = RouteOptimizationClient.get_transport_class("rest")( - credentials=ga_credentials.AnonymousCredentials() - ) - assert transport.kind == "rest" + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() -def test_optimize_tours_rest_bad_request( +def test_optimize_tours_long_running_rest_bad_request( request_type=route_optimization_service.OptimizeToursRequest, ): client = RouteOptimizationClient( @@ -2168,7 +3309,7 @@ def test_optimize_tours_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.optimize_tours(request) + client.optimize_tours_long_running(request) @pytest.mark.parametrize( @@ -2178,7 +3319,7 @@ def test_optimize_tours_rest_bad_request( dict, ], ) -def test_optimize_tours_rest_call_success(request_type): +def test_optimize_tours_long_running_rest_call_success(request_type): client = RouteOptimizationClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2190,29 +3331,23 @@ def test_optimize_tours_rest_call_success(request_type): # Mock the http request call within the method and fake a response. with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. - return_value = route_optimization_service.OptimizeToursResponse( - request_label="request_label_value", - ) + return_value = operations_pb2.Operation(name="operations/spam") # Wrap the value into a proper Response obj response_value = mock.Mock() response_value.status_code = 200 - - # Convert return value to protobuf type - return_value = route_optimization_service.OptimizeToursResponse.pb(return_value) json_return_value = json_format.MessageToJson(return_value) response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.optimize_tours(request) + response = client.optimize_tours_long_running(request) # Establish that the response is the type that we expect. - assert isinstance(response, route_optimization_service.OptimizeToursResponse) - assert response.request_label == "request_label_value" + json_return_value = json_format.MessageToJson(return_value) @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_optimize_tours_rest_interceptors(null_interceptor): +def test_optimize_tours_long_running_rest_interceptors(null_interceptor): transport = transports.RouteOptimizationRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -2226,11 +3361,14 @@ def test_optimize_tours_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.RouteOptimizationRestInterceptor, "post_optimize_tours" + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.RouteOptimizationRestInterceptor, "post_optimize_tours_long_running" ) as post, mock.patch.object( - transports.RouteOptimizationRestInterceptor, "post_optimize_tours_with_metadata" + transports.RouteOptimizationRestInterceptor, + "post_optimize_tours_long_running_with_metadata", ) as post_with_metadata, mock.patch.object( - transports.RouteOptimizationRestInterceptor, "pre_optimize_tours" + transports.RouteOptimizationRestInterceptor, "pre_optimize_tours_long_running" ) as pre: pre.assert_not_called() post.assert_not_called() @@ -2248,9 +3386,7 @@ def test_optimize_tours_rest_interceptors(null_interceptor): req.return_value = mock.Mock() req.return_value.status_code = 200 req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - return_value = route_optimization_service.OptimizeToursResponse.to_json( - route_optimization_service.OptimizeToursResponse() - ) + return_value = json_format.MessageToJson(operations_pb2.Operation()) req.return_value.content = return_value request = route_optimization_service.OptimizeToursRequest() @@ -2259,13 +3395,10 @@ def test_optimize_tours_rest_interceptors(null_interceptor): ("cephalopod", "squid"), ] pre.return_value = request, metadata - post.return_value = route_optimization_service.OptimizeToursResponse() - post_with_metadata.return_value = ( - route_optimization_service.OptimizeToursResponse(), - metadata, - ) + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata - client.optimize_tours( + client.optimize_tours_long_running( request, metadata=[ ("key", "val"), @@ -2278,8 +3411,8 @@ def test_optimize_tours_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_batch_optimize_tours_rest_bad_request( - request_type=route_optimization_service.BatchOptimizeToursRequest, +def test_optimize_tours_uri_rest_bad_request( + request_type=route_optimization_service.OptimizeToursUriRequest, ): client = RouteOptimizationClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" @@ -2300,17 +3433,17 @@ def test_batch_optimize_tours_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.batch_optimize_tours(request) + client.optimize_tours_uri(request) @pytest.mark.parametrize( "request_type", [ - route_optimization_service.BatchOptimizeToursRequest, + route_optimization_service.OptimizeToursUriRequest, dict, ], ) -def test_batch_optimize_tours_rest_call_success(request_type): +def test_optimize_tours_uri_rest_call_success(request_type): client = RouteOptimizationClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2331,14 +3464,14 @@ def test_batch_optimize_tours_rest_call_success(request_type): response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.batch_optimize_tours(request) + response = client.optimize_tours_uri(request) # Establish that the response is the type that we expect. json_return_value = json_format.MessageToJson(return_value) @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_batch_optimize_tours_rest_interceptors(null_interceptor): +def test_optimize_tours_uri_rest_interceptors(null_interceptor): transport = transports.RouteOptimizationRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None @@ -2354,18 +3487,18 @@ def test_batch_optimize_tours_rest_interceptors(null_interceptor): ) as transcode, mock.patch.object( operation.Operation, "_set_result_from_operation" ), mock.patch.object( - transports.RouteOptimizationRestInterceptor, "post_batch_optimize_tours" + transports.RouteOptimizationRestInterceptor, "post_optimize_tours_uri" ) as post, mock.patch.object( transports.RouteOptimizationRestInterceptor, - "post_batch_optimize_tours_with_metadata", + "post_optimize_tours_uri_with_metadata", ) as post_with_metadata, mock.patch.object( - transports.RouteOptimizationRestInterceptor, "pre_batch_optimize_tours" + transports.RouteOptimizationRestInterceptor, "pre_optimize_tours_uri" ) as pre: pre.assert_not_called() post.assert_not_called() post_with_metadata.assert_not_called() - pb_message = route_optimization_service.BatchOptimizeToursRequest.pb( - route_optimization_service.BatchOptimizeToursRequest() + pb_message = route_optimization_service.OptimizeToursUriRequest.pb( + route_optimization_service.OptimizeToursUriRequest() ) transcode.return_value = { "method": "post", @@ -2380,7 +3513,7 @@ def test_batch_optimize_tours_rest_interceptors(null_interceptor): return_value = json_format.MessageToJson(operations_pb2.Operation()) req.return_value.content = return_value - request = route_optimization_service.BatchOptimizeToursRequest() + request = route_optimization_service.OptimizeToursUriRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), @@ -2389,7 +3522,7 @@ def test_batch_optimize_tours_rest_interceptors(null_interceptor): post.return_value = operations_pb2.Operation() post_with_metadata.return_value = operations_pb2.Operation(), metadata - client.batch_optimize_tours( + client.optimize_tours_uri( request, metadata=[ ("key", "val"), @@ -2513,6 +3646,50 @@ def test_batch_optimize_tours_empty_call_rest(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_optimize_tours_long_running_empty_call_rest(): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_long_running), "__call__" + ) as call: + client.optimize_tours_long_running(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = route_optimization_service.OptimizeToursRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_optimize_tours_uri_empty_call_rest(): + client = RouteOptimizationClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.optimize_tours_uri), "__call__" + ) as call: + client.optimize_tours_uri(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = route_optimization_service.OptimizeToursUriRequest() + + assert args[0] == request_msg + + def test_route_optimization_rest_lro_client(): client = RouteOptimizationClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2565,6 +3742,8 @@ def test_route_optimization_base_transport(): methods = ( "optimize_tours", "batch_optimize_tours", + "optimize_tours_long_running", + "optimize_tours_uri", "get_operation", ) for method in methods: @@ -2835,6 +4014,12 @@ def test_route_optimization_client_transport_session_collision(transport_name): session1 = client1.transport.batch_optimize_tours._session session2 = client2.transport.batch_optimize_tours._session assert session1 != session2 + session1 = client1.transport.optimize_tours_long_running._session + session2 = client2.transport.optimize_tours_long_running._session + assert session1 != session2 + session1 = client1.transport.optimize_tours_uri._session + session2 = client2.transport.optimize_tours_uri._session + assert session1 != session2 def test_route_optimization_grpc_transport_channel():